Perinci::CmdLine - Rinci/Riap-based command-line application framework
This document describes version 1.34 of Perinci::CmdLine (from Perl distribution Perinci-CmdLine), released on 2014-10-14.
See Perinci::CmdLine::Manual::Examples.
See Perinci::CmdLine::Manual.
Screenshots:
Autogenerated help message
Autogenerated help message (verbose mode)
Progress bar
Tab completion
Some output formats
Undo/redo
See also Perinci::CmdLine::Base. Extra stuffs put by this module to the $r hash/stash.
$r
format_options => hash
All the attributes of Perinci::CmdLine::Base, plus:
Whether to load Log::Any::App (enable logging output) by default. See "LOGGING" for more details.
From SHARYANTO::Role::TermAttrs (please see its docs for more details). There are several other attributes added by the role.
Whether to enable undo/redo functionality. Some things to note if you intend to use undo:
These common command-line options will be recognized
--undo, --redo, --history, --clear-history.
--undo
--redo
--history
--clear-history
Transactions will be used
use_tx=>1 will be passed to Perinci::Access, which will cause it to initialize the transaction manager. Riap requests begin_tx and commit_tx will enclose the call request to function.
use_tx=>1
Called function will need to support transaction and undo
Function which does not meet qualifications will refuse to be called.
Exception is when subcommand is specified with undo=>0, where transaction will not be used for that subcommand. For an example of disabling transaction for some subcommands, see bin/u-trash in the distribution.
undo=>0
bin/u-trash
Where to put undo data. This is actually the transaction manager's data dir.
All the methods of Perinci::CmdLine::Base, plus:
All those supported by Perinci::CmdLine::Base, plus:
All the environment variables that Perinci::CmdLine::Base supports, plus:
Can be used to set color_theme.
color_theme
Explicitly turn the progress bar on/off.
Please see SHARYANTO::Role::TermAttrs.
Perinci, Rinci, Riap.
Perinci::CmdLine::Base.
Perinci::CmdLine::Lite.
Other CPAN modules to write command-line applications: App::Cmd, App::Rad, MooseX::Getopt.
Please visit the project's homepage at https://metacpan.org/release/Perinci-CmdLine.
Source repository is at https://github.com/perlancar/perl-Perinci-CmdLine.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-CmdLine
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2014 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Perinci::CmdLine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perinci::CmdLine
CPAN shell
perl -MCPAN -e shell install Perinci::CmdLine
For more information on module installation, please visit the detailed CPAN module installation guide.