prevent -h being an alias for --help, since we use it for --host
Graham Knop [Thu, 21 Jul 2022 08:31:25 +0000 (10:31 +0200)]
The -h flag is meant to be an alias for --host, but MooseX::Getopt added
it as an alias for --help in version 0.46 (2012-08-30). This conflict
has been silently ignored since then, until Getopt::Long::Descriptive
added a warning for this in version 0.106 (2021-03-12).

Modify the help option to remove the -h alias. We could try to filter
the 'h' option out, but it's easier to just hard code the aliases we
want to allow.

lib/Catalyst/Script/Server.pm

index 6c859b9..2fb80f3 100644 (file)
@@ -44,6 +44,10 @@ has port => (
     documentation => 'Specify a different listening port (to the default port 3000)',
 );
 
+has '+help_flag' => (
+    cmd_aliases => [ qw(usage ?) ],
+);
+
 use Moose::Util::TypeConstraints;
 class_type 'MooseX::Daemonize::Pid::File';
 subtype 'Catalyst::Script::Server::Types::Pidfile',