10#include <QtCore/QString>
11#include <QtCore/QStringList>
30 QList<std::pair<QString, QString>>
flags;
void usageError(const ArgumentSpec &spec, const QString &message)
Prints the usage of spec and message, and exits with 2, as argparse's error() does.
Definition arguments.cpp:185
Arguments parseArguments(const ArgumentSpec &spec, const QStringList &args)
Reads args as spec says.
Definition arguments.cpp:224
QString helpText(const ArgumentSpec &spec)
The help -h prints for spec.
Definition arguments.cpp:192
What a command accepts.
Definition arguments.h:28
bool positionalOptional
Whether it takes at most one positional argument.
Definition arguments.h:33
QList< ValueOption > values
The options with a value, listed after the flags.
Definition arguments.h:32
QString positionalHelp
The positional arguments' help text, or empty.
Definition arguments.h:35
QList< std::pair< QString, QString > > flags
Each flag ("--all") and its help text.
Definition arguments.h:30
QString positional
The name of its positional arguments ("names"), or empty for none.
Definition arguments.h:31
QString prog
The command, as usage names it: "sonde trust".
Definition arguments.h:29
The arguments read.
Definition arguments.h:40
QSet< QString > flags
The flags given, in full ("--revoke").
Definition arguments.h:41
QStringList positionals
The positional arguments.
Definition arguments.h:42
QHash< QString, QString > values
The value of each option given that takes one.
Definition arguments.h:43
An option that takes a value, such as -n N.
Definition arguments.h:19
QString name
The option: "-n" or "--timeout".
Definition arguments.h:20
QString help
Its help text, or empty.
Definition arguments.h:22
QString metavar
What usage calls its value: "N".
Definition arguments.h:21
bool integer
Whether the value must be an integer.
Definition arguments.h:23