Sietima::CmdLine - run Sietima as a command-line application
version 1.0.0
use Sietima::CmdLine; Sietima::CmdLine->new({ traits => [qw(SubjectTag)], args => { return_path => 'list@example.net', subject_tag => 'Test', subscribers => \@addresses, })->run;
This class simplifies the creation of a Sietima object, and uses App::Spec to provide a command-line interface to it.
Sietima
App::Spec
sietima
Required, an instance of Sietima. You can either construct it yourself, or use the simplified building provided by the constructor.
extra_spec
Optional hashref. Used inside "app_spec". If you're not familiar with App::Spec, you probably don't want to touch this.
app_spec
new
my $cmdline = Sietima::CmdLine->new({ sietima => Sietima->with_traits(qw(SubjectTag))->new({ return_path => 'list@example.net', subject_tag => 'Test', subscribers => \@addresses, }), }); my $cmdline = Sietima::CmdLine->new({ traits => [qw(SubjectTag)], args => { return_path => 'list@example.net', subject_tag => 'Test', subscribers => \@addresses, });
The constructor. In alternative to passing a Sietima instance, you can pass traits and args, and the instance will be built for you. The two calls above are equivalent.
traits
args
Returns an instance of App::Spec, built from the specification returned by calling command_line_spec on the "sietima" object, modified by the "extra_spec". This method, and the extra_spec attribute, are probably only interesting to people who are doing weird extensions.
command_line_spec
runner
Returns an instance of Sietima::Runner, built from the "app_spec".
Sietima::Runner
run
Delegates to the "runner"'s run method.
Parser the command line arguments from @ARGV and executes the appropriate action.
@ARGV
Gianni Ceccarelli <dakkar@thenautilus.net>
This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
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 Sietima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sietima
CPAN shell
perl -MCPAN -e shell install Sietima
For more information on module installation, please visit the detailed CPAN module installation guide.