[wx-dev] [ wxwindows-Patches-1957542 ] Added wxCMD_LINE_TEXT to wxCmdLineParser

SourceForge.net noreply at sourceforge.net
Sun May 4 16:19:00 PDT 2008


Patches item #1957542, was opened at 2008-05-04 23:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1957542&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Marcin 'Malcom' Malich (malcompl)
Assigned to: Nobody/Anonymous (nobody)
Summary: Added wxCMD_LINE_TEXT to wxCmdLineParser

Initial Comment:
Added wxCMD_LINE_TEXT to adding text which can be shown in usage information.

Example

cmdLineDesc:

const wxCmdLineEntryDesc cmdLineDesc[] = {
    { wxCMD_LINE_TEXT, NULL, NULL, "Options:", wxCMD_LINE_VAL_NONE, 0 },
    { wxCMD_LINE_SWITCH, "h", "help", "show this help message", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
    { wxCMD_LINE_SWITCH, "v", "ver", "show version information", wxCMD_LINE_VAL_NONE, wxCMD_LINE_NEEDS_SEPARATOR },
    { wxCMD_LINE_TEXT, NULL, NULL, "Group options 1:", wxCMD_LINE_VAL_NONE, 0 },
    { wxCMD_LINE_OPTION, "o1", "opt1", "description of option1", wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
    { wxCMD_LINE_OPTION, "o2", "opt2", "description of option2", wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR },
    { wxCMD_LINE_SWITCH, "s1", "swt1", "description of switch1", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
    { wxCMD_LINE_TEXT, NULL, NULL, "Group options 2:", wxCMD_LINE_VAL_NONE, 0 },
    { wxCMD_LINE_OPTION, "k", "", "description of k option", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
    { wxCMD_LINE_SWITCH, "n", "swt1", "description of n switch", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
    { wxCMD_LINE_TEXT, NULL, NULL, "Info about support, help or sth else.", wxCMD_LINE_VAL_NONE, 0 },
    wxCMD_LINE_DESC_END
};


usage info:

logo text
Usage: app [/h] [/v] [/o1 <str>] [/o2 <str>] [/s1] [/k <str>] [/n]
Options:
  /h, --help       	show this help message
  /v, --ver        	show version information
Group options 1:
  /o1, --opt1=<str>	description of option1
  /o2, --opt2=<str>	description of option2
  /s1, --swt1      	description of switch1
Group options 2:
  /k:<str>         	description of k option
  /n, --swt1       	description of n switch
Info about support, help or sth else.

Maybe we should add \n before text, and after logo text, looks better like this.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1957542&group_id=9863


More information about the wx-dev mailing list