Permalink
Browse files

Fix another bug updating alias list.

  • Loading branch information...
1 parent 6f4a661 commit ad84a30e6f51203f2910658049fe65ca90fb427b rocky committed Aug 27, 2012
View
@@ -29,8 +29,8 @@ my $builder = Module::Build->new(
dist_version_from => 'lib/Devel/Trepan.pm',
license => 'gpl',
needs_compiler => 0,
- release_status => 'stable', # or 'testing'
- # release_status => 'testing', # or 'stable'
+ # release_status => 'stable', # or 'testing'
+ release_status => 'testing', # or 'stable'
meta_merge => {
resources => {
View
@@ -23,6 +23,7 @@ lib/Devel/Trepan.pm
lib/Devel/Trepan/BrkptMgr.pm
lib/Devel/Trepan/Client.pm
lib/Devel/Trepan/CmdProcessor.pm
+lib/Devel/Trepan/CmdProcessor/Alias.pm
lib/Devel/Trepan/CmdProcessor/Command.pm
lib/Devel/Trepan/CmdProcessor/Command/Action.pm
lib/Devel/Trepan/CmdProcessor/Command/Alias.pm
View
@@ -4,7 +4,7 @@
"Rocky Bernstein <rocky@cpan.org>"
],
"dynamic_config" : 1,
- "generated_by" : "Module::Build version 0.4, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Module::Build version 0.3901, CPAN::Meta::Converter version 2.120630",
"license" : [
"open_source"
],
@@ -44,10 +44,6 @@
"file" : "lib/Devel/Trepan/DB/LineCache.pm",
"version" : 0
},
- "DB::fake" : {
- "file" : "lib/Devel/Trepan/DB.pm",
- "version" : 0
- },
"DBBreak" : {
"file" : "lib/Devel/Trepan/DB/Breakpoint.pm",
"version" : 0
@@ -58,7 +54,7 @@
},
"Devel::Trepan" : {
"file" : "lib/Devel/Trepan.pm",
- "version" : "0.33"
+ "version" : "0.34"
},
"Devel::Trepan::BrkptMgr" : {
"file" : "lib/Devel/Trepan/BrkptMgr.pm",
@@ -272,6 +268,22 @@
"file" : "lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Confirm.pm",
"version" : 0
},
+ "Devel::Trepan::CmdProcessor::Command::Set::Debug" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug.pm",
+ "version" : 0
+ },
+ "Devel::Trepan::CmdProcessor::Command::Set::Debug::Except" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug_Subcmd/Except.pm",
+ "version" : 0
+ },
+ "Devel::Trepan::CmdProcessor::Command::Set::Debug::Macro" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug_Subcmd/Macro.pm",
+ "version" : 0
+ },
+ "Devel::Trepan::CmdProcessor::Command::Set::Debug::Skip" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug_Subcmd/Skip.pm",
+ "version" : 0
+ },
"Devel::Trepan::CmdProcessor::Command::Set::Different" : {
"file" : "lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Different.pm",
"version" : 0
@@ -376,6 +388,22 @@
"file" : "lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Confirm.pm",
"version" : 0
},
+ "Devel::Trepan::CmdProcessor::Command::Show::Debug" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug.pm",
+ "version" : 0
+ },
+ "Devel::Trepan::CmdProcessor::Command::Show::Debug::Except" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug_Subcmd/Except.pm",
+ "version" : 0
+ },
+ "Devel::Trepan::CmdProcessor::Command::Show::Debug::Macro" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug_Subcmd/Macro.pm",
+ "version" : 0
+ },
+ "Devel::Trepan::CmdProcessor::Command::Show::Debug::Skip" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug_Subcmd/Skip.pm",
+ "version" : 0
+ },
"Devel::Trepan::CmdProcessor::Command::Show::Different" : {
"file" : "lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Different.pm",
"version" : 0
@@ -594,7 +622,7 @@
},
"Devel::Trepan::Options" : {
"file" : "lib/Devel/Trepan/Options.pm",
- "version" : "0.33"
+ "version" : "0.34"
},
"Devel::Trepan::SigHandler" : {
"file" : "lib/Devel/Trepan/SigHandler.pm",
@@ -604,6 +632,10 @@
"file" : "lib/Devel/Trepan/SigHandler.pm",
"version" : 0
},
+ "Devel::Trepan::Terminated" : {
+ "file" : "lib/Devel/Trepan/DB.pm",
+ "version" : 0
+ },
"Devel::Trepan::Util" : {
"file" : "lib/Devel/Trepan/Util.pm",
"version" : 0
@@ -627,11 +659,11 @@
"web" : "https://github.com/rocky/Perl-Devel-Trepan/issues"
},
"license" : [
- "http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt"
+ "http://opensource.org/licenses/gpl-license.php"
],
"repository" : {
"url" : "http://github.com/rocky/Perl-Devel-Trepan"
}
},
- "version" : "0.33"
+ "version" : "0.34"
}
View
@@ -6,7 +6,7 @@ build_requires: {}
configure_requires:
Module::Build: 0.32
dynamic_config: 1
-generated_by: 'Module::Build version 0.4, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Module::Build version 0.3901, CPAN::Meta::Converter version 2.120630'
license: open_source
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -16,9 +16,6 @@ provides:
DB::LineCache:
file: lib/Devel/Trepan/DB/LineCache.pm
version: 0
- DB::fake:
- file: lib/Devel/Trepan/DB.pm
- version: 0
DBBreak:
file: lib/Devel/Trepan/DB/Breakpoint.pm
version: 0
@@ -27,7 +24,7 @@ provides:
version: 0
Devel::Trepan:
file: lib/Devel/Trepan.pm
- version: 0.33
+ version: 0.34
Devel::Trepan::BrkptMgr:
file: lib/Devel/Trepan/BrkptMgr.pm
version: 0
@@ -187,6 +184,18 @@ provides:
Devel::Trepan::CmdProcessor::Command::Set::Confirm:
file: lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Confirm.pm
version: 0
+ Devel::Trepan::CmdProcessor::Command::Set::Debug:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug.pm
+ version: 0
+ Devel::Trepan::CmdProcessor::Command::Set::Debug::Except:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug_Subcmd/Except.pm
+ version: 0
+ Devel::Trepan::CmdProcessor::Command::Set::Debug::Macro:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug_Subcmd/Macro.pm
+ version: 0
+ Devel::Trepan::CmdProcessor::Command::Set::Debug::Skip:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Debug_Subcmd/Skip.pm
+ version: 0
Devel::Trepan::CmdProcessor::Command::Set::Different:
file: lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Different.pm
version: 0
@@ -265,6 +274,18 @@ provides:
Devel::Trepan::CmdProcessor::Command::Show::Confirm:
file: lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Confirm.pm
version: 0
+ Devel::Trepan::CmdProcessor::Command::Show::Debug:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug.pm
+ version: 0
+ Devel::Trepan::CmdProcessor::Command::Show::Debug::Except:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug_Subcmd/Except.pm
+ version: 0
+ Devel::Trepan::CmdProcessor::Command::Show::Debug::Macro:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug_Subcmd/Macro.pm
+ version: 0
+ Devel::Trepan::CmdProcessor::Command::Show::Debug::Skip:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Debug_Subcmd/Skip.pm
+ version: 0
Devel::Trepan::CmdProcessor::Command::Show::Different:
file: lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Different.pm
version: 0
@@ -429,13 +450,16 @@ provides:
version: 0
Devel::Trepan::Options:
file: lib/Devel/Trepan/Options.pm
- version: 0.33
+ version: 0.34
Devel::Trepan::SigHandler:
file: lib/Devel/Trepan/SigHandler.pm
version: 0
Devel::Trepan::SigMgr:
file: lib/Devel/Trepan/SigHandler.pm
version: 0
+ Devel::Trepan::Terminated:
+ file: lib/Devel/Trepan/DB.pm
+ version: 0
Devel::Trepan::Util:
file: lib/Devel/Trepan/Util.pm
version: 0
@@ -465,6 +489,6 @@ requires:
version: 0
resources:
bugtracker: https://github.com/rocky/Perl-Devel-Trepan/issues
- license: http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt
+ license: http://opensource.org/licenses/gpl-license.php
repository: http://github.com/rocky/Perl-Devel-Trepan
-version: 0.33
+version: 0.34
View
@@ -8,7 +8,7 @@ package Devel::Trepan;
use strict;
use warnings;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-use version; $VERSION = '0.34';
+use version; $VERSION = '0.34_01';
use Exporter;
use Devel::Trepan::Core;
@@ -27,6 +27,7 @@ unless (@ISA) {
eval "require Devel::Trepan::DB::Display";
require Devel::Trepan::Interface::User;
require Devel::Trepan::CmdProcessor::Virtual;
+ require Devel::Trepan::CmdProcessor::Alias;
require Devel::Trepan::CmdProcessor::Default;
require Devel::Trepan::CmdProcessor::Msg;
require Devel::Trepan::CmdProcessor::Help;
@@ -0,0 +1,30 @@
+# Copyright (C) 2012 Rocky Bernstein <rocky@cpan.org>
+# Part of Trepan::CmdProcess that deails with alias routines
+use rlib '../../..';
+
+package Devel::Trepan::CmdProcessor;
+
+sub add_alias($$$) {
+ my ($self, $command_name, $alias, $cmd_str) = @_;
+
+ # Update array inside command name
+ my $cmd_alias_ref = $self->{commands}{$command_name}{aliases};
+ push @$cmd_alias_ref, $alias;
+
+ # Upate aliases hash
+ $self->{aliases}{$alias} = $cmd_str;
+}
+
+sub remove_alias($$$) {
+ my ($self, $command_name, $alias) = @_;
+
+ # Update array inside command name
+ my $cmd_alias_ref = $self->{commands}{$command_name}{aliases};
+ my @new_aliases = grep(($alias ne $_), @$cmd_alias_ref);
+ $self->{commands}{$command_name}{aliases} = \@new_aliases;
+
+ # Upate aliases hash
+ delete $self->{aliases}{$alias};
+}
+
+1;
@@ -53,8 +53,9 @@ sub run($$) {
my $old_command = $proc->{aliases}{$al};
if (exists $proc->{commands}{$command}) {
my $cmd_str = join(' ', ($command, @rest));
- $proc->{aliases}{$al} = $cmd_str;
+ $proc->add_alias($command, $al, $cmd_str);
if ($old_command) {
+ $proc->remove_alias($old_command);
$self->msg("Alias '${al}' for command string '${cmd_str}' replaced old " .
"alias for '${old_command}'.");
} else {
@@ -49,10 +49,7 @@ sub run($$) {
for my $arg (@args) {
if (exists $proc->{aliases}{$arg}) {
my $command_name = $proc->{aliases}{$arg};
- my $cmd_alias_ref = $proc->{commands}{$command_name}{aliases};
- my @new_aliases = grep(($arg ne $_), @$cmd_alias_ref);
- $proc->{commands}{$command_name}{aliases} = \@new_aliases;
- delete $proc->{aliases}{$arg};
+ $proc->remove_alias($command_name, $arg);
$proc->msg("Alias for ${arg} removed.");
} else {
$proc->msg("No alias found for ${arg}.");
@@ -17,7 +17,7 @@ our @ISA;
BEGIN {
$PROGRAM_NAME = 'trepan.pl';
- $VERSION = '0.34';
+ $VERSION = '0.34_01';
}
use constant VERSION => $VERSION;
View
@@ -8,3 +8,11 @@ evd
evd dumper
alias evd set display eval dumper
evd
+alias upper up
+help up
+unalias upper
+help up
+set auto eval off
+upper
+quit!
+
View
@@ -9,3 +9,23 @@ evd: set display eval
*** Command 'set display eval' needs at least 1 argument(s); got 0.
Eval result display style is dumper.
Alias 'evd' for command string 'set display eval dumper' replaced old alias for 'set display eval'.
+Eval result display style is dumper.
+New alias 'upper' for command string 'up' created.
+up [COUNT]
+
+Move the current frame up in the stack trace (to an older frame). 0 is
+the most recent frame. If no count is given, move up 1.
+
+See also 'down' and 'frame'.
+
+Aliases: upper
+Alias for upper removed.
+up [COUNT]
+
+Move the current frame up in the stack trace (to an older frame). 0 is
+the most recent frame. If no count is given, move up 1.
+
+See also 'down' and 'frame'.
+
+set auto eval is off.
+*** Undefined command: "upper". Try "help".

0 comments on commit ad84a30

Please sign in to comment.