App::Cmdline::Options::Basic - set of basic options for command-line applications
version 0.1.2
# In your module that represents a command-line application: sub opt_spec { my $self = shift; return $self->check_for_duplicates ( [ 'check|c' => "only check the configuration" ], ..., $self->composed_of ( 'App::Cmdline::Options::Basic', # here are the basic options added 'App::Cmdline::Options::DB', # here may be other options ) ); }
This is a kind of a role module, defining a particular set of command-line options and their validation. See more about how to write a module that represents a command-line application and that uses this set of options in App::Cmdline.
Particularly, this module specifies the basic options, usually used by any command-line application:
[ 'h' => "display a short usage message" ], [ 'version|v' => "display a version" ],
It prints a short usage message, something like this:
Usage: myapp [non-bundled short or long options] -h display a short usage message -v --version display a version
It print the version of the application and exits in one of the two possible ways: If it is called from and eval
expression, it dies (so you can catch it and continue). Otherwise, it exists with the exit code zero.
Martin Senger <martin.senger@gmail.com>
This software is copyright (c) 2013 by Martin Senger, CBRC - KAUST (Computational Biology Research Center - King Abdullah University of Science and Technology) All Rights Reserved.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.