1MooseX::App::Command(3)User Contributed Perl DocumentatioMnooseX::App::Command(3)
2
3
4

NAME

6       MooseX::App::Command - Load command class metaclasses
7

SYNOPSIS

9        package MyApp::SomeCommand;
10
11        use MooseX::App::Command; # Also loads Moose
12
13        option 'testattr' => (
14           isa             => 'rw',
15           cmd_tags        => [qw(Important! Nice))],
16        );
17
18        command_short_description 'This is a short description';
19        command_long_description 'This is a much longer description yadda yadda';
20        command_usage 'script some_command --testattr 123';
21

DESCRIPTION

23       By loading this class into your command classes you import all required
24       symbols, and enable all documentation features such as:
25
26       •   Parsing command documentation from Pod
27
28       •   Setting the command documentation manually via
29           "command_short_description" and "command_long_description"
30
31       •   Overriding the automated usage header with custom usage from Pod or
32           via "command_usage"
33
34       •   Adding the "cmd_tags", "cmd_flag", "cmd_aliases" and "cmd_type"
35           attributes to options
36

FUNCTIONS

38   command_short_description
39       Set the short description. If not set this information will be taken
40       from the Pod NAME or ABSTRACT section. Alternative this will be taken
41       from the DistZilla ABSTRACT tag.
42
43   command_long_description
44       Set the long description. If not set this information will be taken
45       from the Pod DESCRIPTION or OVERVIEW sections.
46
47   command_usage
48       Set custom usage. If not set this will be taken from the Pod SYNOPSIS
49       or USAGE section. If those sections are not available, the usage
50       information will be autogenerated.
51
52   command_strict
53        command_strict(0); # default
54        OR
55        command_strict(1);
56
57       If strict is enabled the program will terminate with an error message
58       if superfluous/unknown positional parameters are supplied. If disabled
59       all extra parameters will be copied to the extra_argv attribute.
60
61       The app_strict function in the app classes allows one to set this
62       option globally.
63
64
65
66perl v5.38.0                      2023-08-08           MooseX::App::Command(3)
Impressum