diff --git a/nodebrew b/nodebrew index a0beac3..0b05b2e 100755 --- a/nodebrew +++ b/nodebrew @@ -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 { @@ -306,7 +306,7 @@ Usage: nodebrew help Show this message nodebrew install Download and install a nodebrew uninstall Uninstall a version - nodebrew use Modify PATH to use + nodebrew use Use nodebrew list List installed versions nodebrew ls Alias for `list` nodebrew ls-remote List remote versions diff --git a/t/command.t b/t/command.t index b60534b..9d329e6 100644 --- a/t/command.t +++ b/t/command.t @@ -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/;