« blib/lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Max_Subcmd/List.pm
↑ Summary
blib/lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Max_Subcmd/String.pm »
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | # Copyright (C) 2011-2012, 2014 Rocky Bernstein <rocky@cpan.org> | ||
| 3 | use warnings; no warnings 'redefine'; no warnings 'once'; | ||
| 4 | use rlib '../../../../../..'; | ||
| 5 | |||
| 6 | package Devel::Trepan::CmdProcessor::Command::Set::Max::Stack; | ||
| 7 | use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd; | ||
| 8 | |||
| 9 | use strict; | ||
| 10 | use vars qw(@ISA @SUBCMD_VARS); | ||
| 11 | @ISA = qw(Devel::Trepan::CmdProcessor::Command::Subsubcmd); | ||
| 12 | # Values inherited from parent | ||
| 13 | |||
| 14 | use vars @Devel::Trepan::CmdProcessor::Command::Subsubcmd::SUBCMD_VARS; | ||
| 15 | |||
| 16 | our $IN_LIST = 1; | ||
| 17 | =pod | ||
| 18 | |||
| 19 | =head2 Synopsis: | ||
| 20 | |||
| 21 | =cut | ||
| 22 | our $HELP = <<"HELP"; | ||
| 23 | =pod | ||
| 24 | |||
| 25 | B<set max stack> I<number> | ||
| 26 | |||
| 27 | Set number of source-code lines to list by default."; | ||
| 28 | |||
| 29 | =head2 See also: | ||
| 30 | |||
| 31 | L<C<show max stack>|Devel::Trepan::CmdProcessor::Show::Max::Strack> | ||
| 32 | |||
| 33 | =cut | ||
| 34 | HELP | ||
| 35 | |||
| 36 | our $MIN_ABBREV = length('lis'); | ||
| 37 | our $SHORT_HELP = 'Set number of lines to list'; | ||
| 38 | |||
| 39 | sub run($$) | ||
| 40 | { | ||
| 41 | my ($self, $args) = @_; | ||
| 42 | my @args = @$args; | ||
| 43 | shift @args; shift @args; shift @args; | ||
| 44 | my $num_str = join(' ', @args); | ||
| 45 | $self->run_set_int($num_str, | ||
| 46 | "The '$self->{cmd_str}' command requires a line width", | ||
| 47 | 0); | ||
| 48 | } | ||
| 49 | |||
| 50 | unless (caller) { | ||
| 51 | # Demo it. | ||
| 52 | # require_relative '../../../mock' | ||
| 53 | # name = File.basename(__FILE__, '.rb') | ||
| 54 | |||
| 55 | # dbgr, set_cmd = MockDebugger::setup('set') | ||
| 56 | # max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor, | ||
| 57 | # set_cmd) | ||
| 58 | # cmd_ary = Trepan::SubSubcommand::SetMaxStack::PREFIX | ||
| 59 | # cmd_name = cmd_ary.join(' ') | ||
| 60 | # subcmd = Trepan::SubSubcommand::SetMaxStacka.new(set_cmd.proc, | ||
| 61 | # max_cmd, | ||
| 62 | # cmd_name) | ||
| 63 | # prefix_run = cmd_ary[1..-1] | ||
| 64 | # subcmd.run(prefix_run) | ||
| 65 | # subcmd.run(prefix_run + %w(0)) | ||
| 66 | # subcmd.run(prefix_run + %w(20)) | ||
| 67 | # name = File.basename(__FILE__, '.rb') | ||
| 68 | # subcmd.summary_help(name) | ||
| 69 | # puts | ||
| 70 | # puts '-' * 20 | ||
| 71 | # puts subcmd.save_command | ||
| 72 | } | ||
| 73 | |||
| 74 | 1; |