Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
arguments.h File Reference

A command's options read as Python's argparse read them in the Python sonde: flags (abbreviated if unambiguous), -h, --, and the same messages. More...

#include <QtCore/QHash>
#include <QtCore/QList>
#include <QtCore/QSet>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <utility>

Go to the source code of this file.

Classes

struct  Sonde::Cli::ValueOption
 An option that takes a value, such as -n N. More...
struct  Sonde::Cli::ArgumentSpec
 What a command accepts. More...
struct  Sonde::Cli::Arguments
 The arguments read. More...

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

void Sonde::Cli::usageError (const ArgumentSpec &spec, const QString &message)
 Prints the usage of spec and message, and exits with 2, as argparse's error() does.
Arguments Sonde::Cli::parseArguments (const ArgumentSpec &spec, const QStringList &args)
 Reads args as spec says.
QString Sonde::Cli::helpText (const ArgumentSpec &spec)
 The help -h prints for spec.

Detailed Description

A command's options read as Python's argparse read them in the Python sonde: flags (abbreviated if unambiguous), -h, --, and the same messages.

Function Documentation

◆ parseArguments()

Arguments Sonde::Cli::parseArguments ( const ArgumentSpec & spec,
const QStringList & args )

Reads args as spec says.

With -h or --help, prints the help and exits with 0; with an argument it doesn't know, prints the usage and an error and exits with 2.