Subject: | Usage description is not being handled as per the documentation |
It would appear that passing the options --?, --help or --usage are not
treated specially by the code.. e.g. the output is the same if any of
these options are passed, vs. some other random option that does not exist.
Perhaps I am misreading the documentation, but the suggestion is that
something special would happen, or at least the string "Unknown option:
help" (or usage, or ?) would not be printed ahead of the attribute
descriptions.
Now, I know this can be achieved by adding an explicit 'help' attribute,
e.g.:
has [ qw(help usage) ] => (
is => 'ro', isa => 'Bool',
documentation => 'placeholder help documentation',
);
sub _getopt_full_usage {
my ($self, $usage) = @_;
print "arbitrary usage text here\n";
print $usage->text;
exit 0;
}
...but this won't work for passing --?, as '?' is not a legal Moose
attribute name.
I found these lines in MooseX::Getopt::Basic, but they don't seem to be
triggered (the code never gets this far - execution is aborted in
_parse_argv()):
# did the user request usage information?
if ( $processed{usage} && ($params->{'?'} or $params->{help} or
$params->{usage}) )
{
$class->_getopt_full_usage($processed{usage});
}