Browse Source

now-alias: pass only strings (minimist converts to `Number`)

master
Guillermo Rauch 9 years ago
parent
commit
b65f57e4d5
  1. 12
      bin/now-alias

12
bin/now-alias

@ -103,22 +103,26 @@ async function run (token) {
switch (subcommand) {
case 'list':
case 'ls':
await alias.ls(argv._[0]);
await alias.ls(null != argv._[0] ? String(argv._[0]) : null);
break;
case 'remove':
case 'rm':
await alias.rm(argv._[0]);
await alias.rm(String(argv._[0]));
break;
case 'add':
case 'set':
await alias.set(argv._[0], argv._[1]);
if (2 !== argv._.length) {
error('Invalid number of arguments');
return;
}
await alias.set(String(argv._[0]), String(argv._[1]));
break;
default:
if (2 === argv._.length) {
await alias.set(argv._[0], argv._[1]);
await alias.set(String(argv._[0]), String(argv._[1]));
} else if (argv._.length >= 3) {
error('Invalid number of arguments');
help();

Loading…
Cancel
Save