Implements feature suggestion RT#58715 by storing the Usage object, fixes
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / GLD.pm
index b2ccafe..5edb937 100644 (file)
@@ -7,6 +7,20 @@ use Getopt::Long::Descriptive 0.081;
 
 with 'MooseX::Getopt::Basic';
 
+has usage => (
+    is => 'rw', isa => 'Getopt::Long::Descriptive::Usage',
+    traits => ['NoGetopt'],
+);
+
+# captures the options: --help --usage --?
+has help_flag => (
+    is => 'ro', isa => 'Bool',
+    traits => ['Getopt'],
+    cmd_flag => 'help',
+    cmd_aliases => [ qw(usage ?) ],
+    documentation => 'Prints this usage information.',
+);
+
 around _getopt_spec => sub {
     shift;
     shift->_gld_spec(@_);