1MooseX::App::Plugin::TeUrsme(r3)Contributed Perl DocumenMtoaotsieoXn::App::Plugin::Term(3)
2
3
4

NAME

6       MooseX::App::Plugin::Term - Allows one to specify options/parameters
7       via terminal prompts
8

SYNOPSIS

10       In your base class:
11
12        package MyApp;
13        use MooseX::App qw(Term);
14
15       In your command class:
16
17        package MyApp::SomeCommand;
18        use MooseX::App::Command;
19
20        option 'some_option' => (
21            is             => 'rw',
22            isa            => 'Int',
23            documentation  => 'Something',
24            cmd_term       => 1,
25        );
26
27        sub run {
28            my ($self) = @_;
29            say "Some option is ".$self->some_option;
30        }
31
32       In your shell
33
34        bash$ myapp some_command
35        Something (Required, an integer):
36        test
37        Value must be an integer (not 'test')
38        1
39
40        Some option is 1
41

DESCRIPTION

43       This plugin can prompt the user for missing options/parameters on the
44       terminal. The user will only be promted if the parameter were not
45       provided by different means (parameter and option or config files and
46       environment values if the respectice plugins have been loaded before
47       this plugin) and if the script is connected to an interactive terminal.
48
49       Term input has basic editing capabilities (cursor, del, backspace and
50       history)
51
52
53
54perl v5.30.0                      2019-07-26      MooseX::App::Plugin::Term(3)
Impressum