Doc Comments / Phobos /
Std Getopt
Difference (last change) (Author, normal page display)
Added: 25a26,30
=== Strict single letter options Currently long option syntax is accepted for single letter options (e.g. --v). Perhaps this is a bug. If not, would like option to disallow it. |
std.getopt
Comments
Option descriptions
It would maybe be sensible to have instead a structure in which we can load every parameter and their descriptions, in order to have an automated --help option :
GetOpt getOpt = new GetOpt( "in", &inFile, "Input file (Raw data)", "out", &outFile, "Output file (XML data)" ) ;then an arg "--help" would print :getOpt.parseAutoHelp(args) ;
--help : this help --in <string> : Input file (Raw data) --out <string> : Output file (XML data)etc.
Synopsis improvement
Hint at use of single letter and multiple name options with "verbose|v".
Strict single letter options
Currently long option syntax is accepted for single letter options (e.g. --v). Perhaps this is a bug. If not, would like option to disallow it.
Links
- Corresponding page in the D Specification
- D 1.x: N/A (see the std2 project)
- D 2.x
- POSIX getopt for Phobos
- Return value for "bool getopt(T...)(ref string[] args, T opts);"