wxCMD_LINE_SWITCH,
wxCMD_LINE_OPTION,
wxCMD_LINE_PARAM,
+ wxCMD_LINE_USAGE_TEXT,
wxCMD_LINE_NONE ///< Use this to terminate the list.
};
described below. For example, @c "-v" might be a switch
meaning "enable verbose mode".
- @b option: Option for us here is something which comes with a value 0
- unlike a switch. For example, @c -o:filename might be an
- option for specifing the name of the output file.
+ unlike a switch. For example, @c -o: @c filename might be an
+ option for specifying the name of the output file.
- @b parameter: This is a required program argument.
+ - @b text: This is a text which can be shown in usage information.
@section cmdlineparser_construction Construction
The same holds for command line description: it can be specified either in
the constructor (with or without the command line itself) or constructed
- later using either SetDesc() or combination of AddSwitch(), AddOption() and
- AddParam() methods.
+ later using either SetDesc() or combination of AddSwitch(), AddOption(),
+ AddParam() and AddUsageText() methods.
Using constructors or SetDesc() uses a (usually const static) table
containing the command line description. If you want to decide which
Another global option is the set of characters which may be used to start
an option (otherwise, the word on the command line is assumed to be a
- parameter). Under Unix, "-" is always used, but Windows has at least two
- common choices for this: "-" and "/". Some programs also use "+". The
+ parameter). Under Unix, @c "-" is always used, but Windows has at least two
+ common choices for this: @c "-" and @c "/". Some programs also use "+". The
default is to use what suits most the current platform, but may be changed
with SetSwitchChars() method.
Specifies both the command line (in Unix format) and the
@ref SetDesc() "command line description".
*/
- wxCmdLineParser(const wxCmdLineEntryDesc* desc, int argc,
- char** argv);
+ wxCmdLineParser(const wxCmdLineEntryDesc* desc, int argc, char** argv);
/**
Specifies both the command line (in Windows format) and the
const wxString& desc = wxEmptyString,
int flags = 0);
+ /**
+ Add a string @a text to the command line description shown by Usage().
+
+ @since 2.9.0
+ */
+ void AddUsageText(const wxString& text);
+
/**
Returns @true if long options are enabled, otherwise @false.
@see SetLogo()
*/
void Usage() const;
+
+ /**
+ Return the string containing the program usage description.
+
+ Call Usage() to directly show this string to the user.
+ */
+ wxString GetUsageString() const;
};