Boost C++ Libraries: Ticket #3733: Detect platform to choose the conventional option for help https://svn.boost.org/trac10/ticket/3733 <p> on POSIX, the --help option is typically used for printing usage information. on Windows, the /? is the typical option for that. </p> <p> It would be cleaner if the user could check with some function whether the &lt;help option&gt; is set or not instead of explicitly checking for the "help" string </p> <pre class="wiki"> if (vm.count("help")) </pre><p> to decide when to print usage information. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3733 Trac 1.4.3 Sascha Ochsenknecht Wed, 09 Dec 2009 10:39:14 GMT cc set https://svn.boost.org/trac10/ticket/3733#comment:1 https://svn.boost.org/trac10/ticket/3733#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">s.ochsenknecht@…</span> added </li> </ul> <p> I usually define a mapping table to map my command line options to the string value, e.g.: </p> <pre class="wiki"> enum MyOptions { HELP = 0, VERSION, INPUT }; string options[] = { "help", "version", "input" }; ... /// usage if (vm.count(options[HELP])) </pre><p> Within my code I then use only the enum type. Errors are then detect during compile time. </p> <p> You can define this options[] array for each platform you want to support and were it is different to the 'reference' array. </p> <p> I sgguest to keep this type of mapping in the client code. Currently there is no 'special' handling for any options, all handled in the same way and I would like to keep this behaviour. </p> <p> My suggestion is to set on "wont fix". </p> <p> Thanks, Sascha </p> Ticket