Stellarium
0.20.4
|
Static Public Member Functions | |
static bool | argsGetOption (const QStringList &argList, QString shortOpt, QString longOpt) |
Check if a QStringList has a CLI-style option in it (before the first –). More... | |
static QVariant | argsGetOptionWithArg (const QStringList &argList, QString shortOpt, QString longOpt, QVariant defaultValue) |
Retrieve the argument to an option from a QStringList. More... | |
static int | argsGetYesNoOption (const QStringList &argList, QString shortOpt, QString longOpt, int defaultValue) |
Check if a QStringList has a yes/no CLI-style option in it, and find out the argument to that parameter. More... | |
static void | parseCLIArgsPreConfig (const QStringList &argList) |
Processing of command line options which is to be done before config file is read. More... | |
static void | parseCLIArgsPostConfig (const QStringList &argList, QSettings *conf) |
Processing of command line options which is to be done after the config file is read. More... | |
|
static |
argList | a list of strings, think argv |
shortOpt | a short-form option string, e.g, "-h" |
longOpt | a long-form option string, e.g. "--help" |
|
static |
Given a list of strings, this function will extract the argument of type T to an option, where the option in an element which matches either the short or long forms, and the argument to that option is the following element in the list, e.g. ("--option", "arg"). It is also possible to extract argument to options which are part of the option element, separated by the "=" character, e.g. ( "--option=arg" ). Type conversion is done using the QTextStream class, and as such possible types which this template function may use are restricted to those where there is a value operator<<() defined in the QTextStream class for that type. The argument list is only processed as far as the first value "--". If an argument "--" is to be retrieved, it must be apecified using the "--option=--" form.
argList | a list of strings, think argv. |
shortOpt | the short form of the option, e.g. "-n". |
longOpt | the long form of the option, e.g. "--number". |
defaultValue | the default value to return if the option was not found in args. |
runtime_error("no_optarg") | the expected argument to the option was not found. |
runtime_error("optarg_type") | the expected argument to the option could not be converted. |
|
static |
e.g. option –use-foo can have parameter "yes" or "no" It is also possible for the argument to take values, "1", "0"; "true", "false";
argList | a list of strings, think argv |
shortOpt | a short-form option string, e.g, "-h" |
longOpt | a long-form option string, e.g. "--help" |
defaultValue | the default value to return if the option was not found in args. |
runtime_error("no_optarg") | the expected argument to the option was not found. The longOpt value is appended in parenthesis. |
runtime_error("optarg_type") | the expected argument to the option could not be converted. The longOpt value is appended in parenthesis. |
|
static |
This gives us the chance to over-ride settings which are in the configuration file.
|
static |
This includes the chance to set the configuration file name. It is to be done in the sub-class of the StelApp, as the sub-class may want to manage the argument list, as is the case with the StelMainWindow version.