| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | package Mail::Summary::Tools::CLI; | ||
| 4 | use base qw/App::Cmd/; | ||
| 5 | |||
| 6 | use Class::Autouse (<<'#\'END_USE' =~ m!(\w+::[\w:]+)!g); | ||
| 7 | #\ | ||
| 8 | |||
| 9 | use Mail::Summary::Tools::CLI::Context; | ||
| 10 | use Mail::Summary::Tools::CLI::Config; | ||
| 11 | |||
| 12 | #'END_USE | ||
| 13 | |||
| 14 | use strict; | ||
| 15 | use warnings; | ||
| 16 | |||
| 17 | use constant global_opt_spec => ( | ||
| 18 | [ "verbose|v!" => "Verbose output" ], | ||
| 19 | ); | ||
| 20 | |||
| 21 | use constant plugin_search_path => __PACKAGE__; | ||
| 22 | |||
| 23 | sub _module_pluggable_options { | ||
| 24 | return ( | ||
| 25 | only => qr/CLI::\w+$/x, # no nested commands | ||
| 26 | except => qr/CLI::(?:Context|Config|Command)$/, | ||
| 27 | ); | ||
| 28 | } | ||
| 29 | |||
| 30 | sub config { | ||
| 31 | my $self = shift; | ||
| 32 | $self->{config} ||= Mail::Summary::Tools::CLI::Config->new(); | ||
| 33 | } | ||
| 34 | |||
| 35 | sub context { | ||
| 36 | my $self = shift; | ||
| 37 | $self->{context} ||= Mail::Summary::Tools::CLI::Context->new(); | ||
| 38 | } | ||
| 39 | |||
| 40 | __PACKAGE__; | ||
| 41 | |||
| 42 | __END__ |