Subject: | Error in Getopt::Easy example (Documentation) |
The documentation for Getopt::Easy starts with the following example:
get_options "v-verbose f-fname= D-debug=uSX",
"usage => "usage: prog [-v] [-f fname] [-D [uSX]] [-H]",
"H";
It contains a syntaxical error with three double quotes on line two and
is also confusing as it suggests that the object accepts a hash instead
of strings. The documentation reads correctly, so it is only the example
that contains this bug.
Additionally there seems to be some confusion as to the required order
of invoking arguments. I must admit that I have performed no tests to
determine what is and what is not valid, but merely picked up on what
appears to me as a contradiction between the documentation and the example;
These invocations are equivalent:
% prog -v -f infile
% prog -f infile -v # different order
% prog -v -finfile
% prog -vf infile
% prog -vfinfile
This shows that the space between -f and infile is optional and that you
can bundle -f with -v but -f must be the last option in the bundle.
As you can see in the second line the f option is the first option given
on the command line.
Regards,
Eldar Marcussen