1MooseX::App::Plugin::CoUnsfeirg(C3o)ntributed Perl DocumMeonotsaetXi:o:nApp::Plugin::Config(3)
2
3
4
6 MooseX::App::Plugin::Config - Config files your MooseX::App
7 applications
8
10 In your base class:
11
12 package MyApp;
13 use MooseX::App qw(Config);
14
15 option 'global_option' => (
16 is => 'rw',
17 isa => 'Int',
18 );
19
20 In your command class:
21
22 package MyApp::Some_Command;
23 use MooseX::App::Command;
24 extends qw(MyApp);
25
26 option 'some_option' => (
27 is => 'rw',
28 isa => 'Str',
29 );
30
31 Now create a config file (see Config::Any) eg. a yaml file:
32
33 ---
34 global:
35 global_option: 123
36 some_command:
37 global_option: 234
38 some_option: "hello world"
39
40 The user can now call the program with a config file:
41
42 bash$ myapp some_command --config /path/to/config.yml
43
45 config
46 Read the config filename
47
48 _config_data
49 The full content of the loaded config file
50
52 Config::Any
53
54
55
56perl v5.28.0 2016-12-18 MooseX::App::Plugin::Config(3)