File Coverage

lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Auto.pm
Criterion Covered Total %
statement 54 54 100.0
branch n/a
condition n/a
subroutine 18 18 100.0
pod n/a
total 72 72 100.0


line stmt bran cond sub pod time code
1             # -*- coding: utf-8 -*-
2             # Copyright (C) 2011-2012, 2014-2015 Rocky Bernstein <rocky@cpan.org>
3 12     12   107 use warnings; no warnings 'redefine'; no warnings 'once';
  12     12   38  
  12     12   495  
  12     2   69  
  12     2   33  
  12     2   441  
  12         68  
  12         35  
  12         318  
  2         23  
  2         10  
  2         98  
  2         20  
  2         6  
  2         106  
  2         19  
  2         7  
  2         90  
4 12     12   73 use rlib '../../../../..';
  12     2   37  
  12         78  
  2         17  
  2         15  
  2         16  
5 12     12   4957 use strict;
  12     2   35  
  12         389  
  2         1361  
  2         10  
  2         83  
6 12     12   76 use vars qw(@ISA @SUBCMD_VARS);
  12     2   38  
  12         768  
  2         19  
  2         7  
  2         199  
7              
8             package Devel::Trepan::CmdProcessor::Command::Set::Auto;
9              
10 12     12   96 use Devel::Trepan::CmdProcessor::Command::Subcmd::Core;
  12     2   31  
  12         347  
  2         22  
  2         8  
  2         101  
11 12     12   80 use Devel::Trepan::CmdProcessor::Command::Subcmd::SubsubMgr;
  12     2   36  
  12         336  
  2         20  
  2         10  
  2         89  
12 12     12   71 use vars qw(@ISA @SUBCMD_VARS);
  12     2   35  
  12         3148  
  2         20  
  2         8  
  2         791  
13             our $MIN_ABBREV = length('au');
14             =pod
15              
16             =head2 Synopsis:
17              
18             =cut
19              
20             our $HELP = <<'HELP';
21             =pod
22              
23             B<set auto> [I<set auto subcommand>]
24              
25             Set controls for things with some sort of automatic default behavior.
26              
27             Run C<help set auto *> for a list of subcommands or C<help set auto> I<name>
28             for help on a particular trace subcommand.
29              
30             =head2 See also:
31              
32             L<C<show auto>|Devel::Trepan::CmdProcessor::Command::Show::Auto>
33              
34             =cut
35             HELP
36              
37             our $SHORT_HELP =
38             "Set controls for some \"automatic\" default behaviors";
39              
40             @ISA = qw(Devel::Trepan::CmdProcessor::Command::SubsubcmdMgr);
41              
42              
43             # sub run($$)
44             # {
45             # my ($self, $args) = @_;
46             # $self->SUPER;
47             # }
48              
49             unless (caller) {
50             # Demo it.
51             # FIXME: DRY with other subcommand manager demo code.
52             require Devel::Trepan::CmdProcessor::Mock;
53             my ($proc, $cmd) =
54             Devel::Trepan::CmdProcessor::Mock::subcmd_setup();
55             Devel::Trepan::CmdProcessor::Mock::subcmd_demo_info($proc, $cmd);
56             for my $arg ('e', 'lis', 'foo') {
57             my @aref = $cmd->complete_token_with_next($arg);
58             printf "%s\n", @aref ? $aref[0]->[0]: 'undef';
59             }
60              
61             print join(' ', @{$cmd->{prefix}}), "\n";
62             $cmd->run($cmd->{prefix});
63              
64             }
65              
66             1;