Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ok, fixed that bug. there's plenty more though

  • Loading branch information...
commit e181b10a1dba8d0cda202703b73fcfc30c66175b 1 parent a98b3b3
@jettero authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 lib/Term/ReadLine/CLISH/Parser.pm
View
20 lib/Term/ReadLine/CLISH/Parser.pm
@@ -350,12 +350,22 @@ sub _try_to_eat_tagged_arguments {
# consume the items
my ($arg) = splice @$cmd_args, $midx, 1;
- my @nom = splice @$arg_tokens, 0, 2;
- { local $" = ", "; debug "[tagged] ate arg=$arg and tok=<@nom>" if $ENV{CLISH_DEBUG}; }
+ if( $arg->is_flag ) {
+ my ($nom) = splice @$arg_tokens, 0, 1;
- # populate the option in argss
- $arg->add_copy_with_token_to_hashref( $out_args => $ntok );
+ debug "[is_flag] ate arg=$arg and tok-nom=<$nom>" if $ENV{CLISH_DEBUG};
+
+ $arg->add_copy_with_token_to_hashref( $out_args => $tok );
+
+ } else {
+ my @nom = splice @$arg_tokens, 0, 2;
+
+ { local $" = ", "; debug "[tagged] ate arg=$arg and tok-nom=<@nom>" if $ENV{CLISH_DEBUG}; }
+
+ # populate the option in argss
+ $arg->add_copy_with_token_to_hashref( $out_args => $ntok );
+ }
return 1; # returning true reboots the _try*
}
@@ -399,7 +409,7 @@ sub _try_to_eat_untagged_arguments {
my ($arg) = splice @$cmd_args, $midx, 1;
my ($nom) = splice @$arg_tokens, 0, 1;
- debug "[untagged] ate arg=$arg and tok=<$nom>" if $ENV{CLISH_DEBUG};
+ debug "[untagged] ate arg=$arg and tok-nom=<$nom>" if $ENV{CLISH_DEBUG};
# populate the option in argss
$arg->add_copy_with_token_to_hashref( $out_args => $tok );
Please sign in to comment.
Something went wrong with that request. Please try again.