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::Command(3) User Contributed Perl Documentation MooseX::App::Command(3)

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

 package MyApp::SomeCommand;
 
 use MooseX::App::Command; # Also loads Moose
 
 option 'testattr' => (
    isa             => 'rw',
    cmd_tags        => [qw(Important! Nice))],
 );
 
 command_short_description 'This is a short description';
 command_long_description 'This is a much longer description yadda yadda';
 command_usage 'script some_command --testattr 123';

By loading this class into your command classes you import all required symbols, and enable all documentation features such as:
  • Parsing command documentation from Pod
  • Setting the command documentation manually via "command_short_description" and "command_long_description"
  • Overriding the automated usage header with custom usage from Pod or via "command_usage"
  • Adding the "cmd_tags", "cmd_flag", "cmd_aliases" and "cmd_type" attributes to options

Set the short description. If not set this information will be taken from the Pod NAME or ABSTRACT section. Alternative this will be taken from the DistZilla ABSTRACT tag.

Set the long description. If not set this information will be taken from the Pod DESCRIPTION or OVERVIEW sections.

Set custom usage. If not set this will be taken from the Pod SYNOPSIS or USAGE section. If those sections are not available, the usage information will be autogenerated.

 command_strict(0); # default
 OR
 command_strict(1);

If strict is enabled the program will terminate with an error message if superfluous/unknown positional parameters are supplied. If disabled all extra parameters will be copied to the extra_argv attribute.

The app_strict function in the app classes allows one to set this option globally.

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.