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

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

In your base class:

 package MyApp;
 use MooseX::App qw(Term);

In your command class:

 package MyApp::SomeCommand;
 use MooseX::App::Command;
 
 option 'some_option' => (
     is             => 'rw',
     isa            => 'Int',
     documentation  => 'Something',
     cmd_term       => 1,
 );
 
 sub run {
     my ($self) = @_;
     say "Some option is ".$self->some_option;
 }

In your shell

 bash$ myapp some_command
 Something (Required, an integer):
 test
 Value must be an integer (not 'test')
 1
 
 Some option is 1

This plugin can prompt the user for missing options/parameters on the terminal. The user will only be promted if the parameter were not provided by different means (parameter and option or config files and environment values if the respectice plugins have been loaded before this plugin) and if the script is connected to an interactive terminal.

Term input has basic editing capabilities (cursor, del, backspace and history)

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.