From b99202785c405ed19c1a038f372b49d14f7914d3 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Tue, 16 Oct 2012 17:48:35 +0200 Subject: [PATCH] Finish the refactoring into cmd_verb and cmd_args. --- lib/perl5db.pl | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/perl5db.pl b/lib/perl5db.pl index acdbf82..0c62c63 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -2244,10 +2244,11 @@ sub _DB__handle_question_mark_command { sub _DB__handle_restart_and_rerun_commands { my ($obj) = @_; + my $cmd_cmd = $obj->cmd_verb; + my $cmd_params = $obj->cmd_args; # R - restart execution. # rerun - controlled restart execution. - if (my ($cmd_cmd, $cmd_params) = - $cmd =~ /\A((?:R)|(?:rerun\s*(.*)))\z/) { + if ($cmd_cmd eq 'rerun' or $cmd_params eq '') { my @args = ($cmd_cmd eq 'R' ? restart() : rerun($cmd_params)); # Close all non-system fds for a clean restart. A more @@ -3797,9 +3798,10 @@ sub _handle_source_command { sub _handle_enable_disable_commands { my $self = shift; - if (my ($which_cmd, $position) - = $DB::cmd =~ /\A(enable|disable)\s+(\S+)\s*\z/) { + my $which_cmd = $self->cmd_verb; + my $position = $self->cmd_args; + if ($position !~ /\s/) { my ($fn, $line_num); if ($position =~ m{\A\d+\z}) { @@ -3923,14 +3925,8 @@ sub _handle_q_command { sub _handle_cmd_wrapper_commands { my $self = shift; - # All of these commands were remapped in perl 5.8.0; - # we send them off to the secondary dispatcher (see below). - if (my ($cmd_letter, $my_arg) = $DB::cmd =~ /\A([aAbBeEhilLMoOPvwW]\b)\s*(.*)/so) { - DB::cmd_wrapper( $cmd_letter, $my_arg, $line ); - next CMD; - } - - return; + DB::cmd_wrapper( $self->cmd_verb, $self->cmd_args, $line ); + next CMD; } sub _handle_special_char_cmd_wrapper_commands { -- 2.7.4