Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Abbrev fixes

  • Loading branch information...
commit 42a574b7f4d103441294e4c8b103f9a875aed0b1 1 parent 11b0bbd
@throughnothing authored
Showing with 22 additions and 2 deletions.
  1. +16 −0 CHANGES
  2. +6 −2 bin/notes
View
16 CHANGES
@@ -3,6 +3,22 @@ Changes from 2011-04-25 00:00:00 +0000 to present.
==================================================
------------------------------------------
+version 0.003 at 2012-04-24 10:14:58 +0000
+------------------------------------------
+
+ Change: b9a1eb5de18d00e9c4d14d2a8479e9f95c9a78bd
+ Author: William Wolf <throughnothing@gmail.com>
+ Date : 2012-04-24 06:10:40 +0000
+
+ Abbrev fixes
+
+ Change: 11b0bbd94e97756f08837846cc90348a871102e1
+ Author: William Wolf <throughnothing@gmail.com>
+ Date : 2012-04-24 05:59:27 +0000
+
+ Add ability to abbreviate commands.
+
+------------------------------------------
version 0.002 at 2012-04-24 09:05:30 +0000
------------------------------------------
View
8 bin/notes
@@ -52,15 +52,19 @@ sub post_process {
say $c->output if $c->output;
}
+sub default { $_[0]->execute( 'help' ) and return }
+
sub invalid {
my ( $c, $cmd ) = @_;
$cmd //= $c->cmd;
unless ($c->is_command($cmd)) {
my @cmds = grep { /^$cmd/ } $c->commands;
- $c->execute( $cmds[0] ) if (@cmds == 1);
+ $cmd = $cmds[0] if (@cmds == 1);
}
- return;
+
+ $c->execute( $cmd ) and return if $c->is_command( $cmd );
+ $c->execute( 'help' ) and return;
}
App::Rad->run;
Please sign in to comment.
Something went wrong with that request. Please try again.