GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MooseX::App::Plugin::Config(3) User Contributed Perl Documentation MooseX::App::Plugin::Config(3)

MooseX::App::Plugin::Config - Config files your MooseX::App applications

In your base class:

 package MyApp;
 use MooseX::App qw(Config);
 
 option 'global_option' => (
     is          => 'rw',
     isa         => 'Int',
 );

In your command class:

 package MyApp::Some_Command;
 use MooseX::App::Command;
 extends qw(MyApp);
 
 option 'some_option' => (
     is          => 'rw',
     isa         => 'Str',
 );

Now create a config file (see Config::Any) eg. a yaml file:

 ---
 global:
   global_option: 123
 some_command:
   global_option: 234
   some_option: "hello world"

The user can now call the program with a config file:

 bash$ myapp some_command --config /path/to/config.yml

Read the config filename

The full content of the loaded config file

Config::Any
2021-08-15 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.