Closed evgeni closed 9 years ago
Instead of writing foo|f=s you can also write foo|f:s for a GetOpt::Long option spec [1], thus making the argument optional.
foo|f=s
foo|f:s
The current implementation of _spec_to_help will wrongly render this as two long options:
_spec_to_help
--dirport, --d:9030 directory port
instead of a short and a long one:
-d, --dirport=INTEGER directory port
This commit fixes the the parsing of the spec, detection of the type and adds tests for a few common cases this could be used in.
[1] http://perldoc.perl.org/Getopt/Long.html#Summary-of-Option-Specifications
thanks for you patch and sorry for the delay.
Instead of writing
foo|f=s
you can also writefoo|f:s
for a GetOpt::Long option spec [1], thus making the argument optional.The current implementation of
_spec_to_help
will wrongly render this as two long options:instead of a short and a long one:
This commit fixes the the parsing of the spec, detection of the type and adds tests for a few common cases this could be used in.
[1] http://perldoc.perl.org/Getopt/Long.html#Summary-of-Option-Specifications