For command-line options, I understand from what I read so far that the options should be like --option_name=value There is a system(I believe it is gnu) which has the long and short versions of options, like -h and --help Also, on winxxx systems, usually the command line options are indicated with a / like /? or /x /X .... Is it possible to tune program_options to choose the platform's default way of treating options? Regards,
Try the syntax: desc.add_options() ( "help", "print help message\n" ) ( "Long-Option-Name,o", ...); and then you have: --Long-Option-Name or -o as valid usages. On Dec 7, 2009, at 8:10 AM, Hicham Mouline wrote:
For command-line options, I understand from what I read so far that the options should be like --option_name=value
There is a system(I believe it is gnu) which has the long and short versions of options, like -h and --help Also, on winxxx systems, usually the command line options are indicated with a / like /? or /x /X ....
Is it possible to tune program_options to choose the platform's default way of treating options?
Regards,
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
James, Hicham's point was to generate OS system dependent short long options notations. Like --help or -h on Posix and /help or /h on Windows. AFAIK, program options does not provide this feature. With Kind Regards, Ovanes On Mon, Dec 7, 2009 at 4:24 PM, James C. Sutherland < James.Sutherland@utah.edu> wrote:
Try the syntax:
desc.add_options() ( "help", "print help message\n" ) ( "Long-Option-Name,o", ...);
and then you have: --Long-Option-Name or -o as valid usages.
On Dec 7, 2009, at 8:10 AM, Hicham Mouline wrote:
For command-line options, I understand from what I read so far that the options should be like --option_name=value
There is a system(I believe it is gnu) which has the long and short versions of options, like -h and --help Also, on winxxx systems, usually the command line options are indicated with a / like /? or /x /X ....
Is it possible to tune program_options to choose the platform's default way of treating options?
Regards,
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Actually, I think you can setup through the mostly undocumented style_t enumeration for using
a "/" but it is not automatic as I recall. See cmdline.hpp for the style_t definition. It also took a
little looking to figure out how to set style_t. I did it once a couple of years ago and I forget offhand
how I did it but could find it if needed.
Larry
----- Original Message -----
From: Ovanes Markarian
To: boost-users@lists.boost.org
Sent: Monday, December 07, 2009 10:33 AM
Subject: Re: [Boost-users] program_options
James,
Hicham's point was to generate OS system dependent short long options notations. Like --help or -h on Posix and /help or /h on Windows. AFAIK, program options does not provide this feature.
With Kind Regards,
Ovanes
On Mon, Dec 7, 2009 at 4:24 PM, James C. Sutherland
On Mon, Dec 7, 2009 at 9:37 AM, Larry
Actually, I think you can setup through the mostly undocumented style_t enumeration for using a "/" but it is not automatic as I recall. See cmdline.hpp for the style_t definition. It also took a little looking to figure out how to set style_t. I did it once a couple of years ago and I forget offhand how I did it but could find it if needed.
That is something I do like about the windows format using / instead of -. I have used a few windows command-line apps that use / to specify options, - to remove something, and + to add something. Makes more sense to me over all; would be nice to have program_options support that style as well. Example: someapp /input=file.tst -optimize +abc Means: the input is file.tst, you disable optimizations, and you enable automatic bounds checking or whatever...
OvermindDL1 wrote:
On Mon, Dec 7, 2009 at 9:37 AM, Larry
wrote: Actually, I think you can setup through the mostly undocumented style_t enumeration for using a "/" but it is not automatic as I recall. See cmdline.hpp for the style_t definition. It also took a little looking to figure out how to set style_t. I did it once a couple of years ago and I forget offhand how I did it but could find it if needed.
That is something I do like about the windows format using / instead of -. I have used a few windows command-line apps that use / to specify options, - to remove something, and + to add something. Makes more sense to me over all; would be nice to have program_options support that style as well.
Example: someapp /input=file.tst -optimize +abc Means: the input is file.tst, you disable optimizations, and you enable automatic bounds checking or whatever...
FWIW, this +something -whatever convention is similar to -fno-something/-fsomething convention such as used, e.g., by gcc. One can use a custom parser to support either, I think there's example of the latter style. - Volodya
participants (6)
-
Hicham Mouline
-
James C. Sutherland
-
Larry
-
Ovanes Markarian
-
OvermindDL1
-
Vladimir Prus