Skip to content

Commit

Permalink
Fix alias command one args output
Browse files Browse the repository at this point in the history
  • Loading branch information
hokaccha committed Mar 12, 2012
1 parent 3913a04 commit 32f7417
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodebrew
Expand Up @@ -210,7 +210,7 @@ sub _cmd_alias {
# get alias
elsif ($key) {
$val = $alias->get($key);
print "$key -> $val";
print $val ? "$key -> $val\n" : "$key is not set alias\n";
}
# get alias all
else {
Expand Down Expand Up @@ -306,7 +306,7 @@ Usage:
nodebrew help Show this message
nodebrew install <version> Download and install a <version>
nodebrew uninstall <version> Uninstall a version
nodebrew use <version> Modify PATH to use <version>
nodebrew use <version> Use <version>
nodebrew list List installed versions
nodebrew ls Alias for `list`
nodebrew ls-remote List remote versions
Expand Down
3 changes: 3 additions & 0 deletions t/command.t
Expand Up @@ -203,6 +203,9 @@ sub run_test {
is $run->('alias', ['foo', 'baz']), "foo -> baz\n";
is $run->('alias'), "foo -> baz\nhoge -> fuga\n";

is $run->('alias', ['baz']), "baz is not set alias\n";
is $run->('alias', ['foo']), "foo -> baz\n";

$run->('alias', ['foo', 'v0.6.0']);
$run->('use', ['foo']);
like $run->('list'), qr/current: v0.6.0/;
Expand Down

0 comments on commit 32f7417

Please sign in to comment.