File Coverage

lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Display.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) 2012, 2014-2015 Rocky Bernstein <rocky@cpan.org>
3 12     12   104 use warnings; no warnings 'redefine'; no warnings 'once';
  12     12   31  
  12     12   467  
  12     2   71  
  12     2   30  
  12     2   362  
  12         71  
  12         26  
  12         296  
  2         19  
  2         9  
  2         81  
  2         13  
  2         7  
  2         79  
  2         15  
  2         6  
  2         69  
4 12     12   67 use rlib '../../../../..';
  12     2   30  
  12         69  
  2         13  
  2         4681  
  2         21  
5 12     12   5024 use strict;
  12     2   37  
  12         330  
  2         1421  
  2         7  
  2         93  
6 12     12   67 use vars qw(@ISA @SUBCMD_VARS);
  12     2   29  
  12         657  
  2         20  
  2         8  
  2         190  
7              
8             package Devel::Trepan::CmdProcessor::Command::Set::Display;
9              
10 12     12   89 use Devel::Trepan::CmdProcessor::Command::Subcmd::Core;
  12     2   30  
  12         298  
  2         21  
  2         8  
  2         83  
11 12     12   73 use Devel::Trepan::CmdProcessor::Command::Subcmd::SubsubMgr;
  12     2   35  
  12         267  
  2         21  
  2         8  
  2         79  
12 12     12   64 use vars qw(@ISA @SUBCMD_VARS);
  12     2   42  
  12         2992  
  2         16  
  2         9  
  2         803  
13             our $MIN_ABBREV = length('di');
14             our $SHORT_HELP = 'Set display attributes';
15             =pod
16              
17             =head2 Synopsis:
18              
19             =cut
20              
21             our $HELP = <<'HELP';
22             =pod
23              
24             B<set display> [I<set display subcommands>]
25              
26             Set display attributes.
27              
28             Run C<set display *> for a list of subcommands or C<help set display>
29             I<name> for help on a particular display option.
30              
31             =head2 See also:
32              
33             L<C<show display>|Devel::Trepan::CmdProcessor::Command::Show::Display>,
34             L<C<set debug
35             eval>|Devel::Trepan::CmdProcessor::Command::Set::Debug::Eval>, and
36             L<C<set debug
37             op>|Devel::Trepan::CmdProcessor::Command::Set::Debug::OP>
38              
39             =cut
40             HELP
41              
42             @ISA = qw(Devel::Trepan::CmdProcessor::Command::SubsubcmdMgr);
43              
44             unless (caller) {
45             # Demo it.
46             # FIXME: DRY with other subcommand manager demo code.
47             require Devel::Trepan::CmdProcessor::Mock;
48             my ($proc, $cmd) =
49             Devel::Trepan::CmdProcessor::Mock::subcmd_setup();
50             Devel::Trepan::CmdProcessor::Mock::subcmd_demo_info($proc, $cmd);
51             for my $arg ('ev', 'op', 'foo') {
52             my @aref = $cmd->complete_token_with_next($arg);
53             printf "%s\n", @aref ? $aref[0]->[0]: 'undef';
54             }
55             $cmd->run($cmd->{prefix});
56             my @args = (@{$cmd->{prefix}}, 'op', 'on');
57             $cmd->run(\@args);
58             }
59              
60             1;