Browse Source

now-alias: refer to `_` to get custom args

master
Guillermo Rauch 9 years ago
parent
commit
4ec6e8ec9d
  1. 10
      bin/now-alias

10
bin/now-alias

@ -93,23 +93,23 @@ async function run (token) {
switch (subcommand) { switch (subcommand) {
case 'list': case 'list':
case 'ls': case 'ls':
await alias.ls(argv[0]); await alias.ls(argv._[0]);
break; break;
case 'remove': case 'remove':
case 'rm': case 'rm':
await alias.rm(argv[0]); await alias.rm(argv._[0]);
break; break;
case 'add': case 'add':
case 'set': case 'set':
await alias.set(argv[0], argv[1]); await alias.set(argv._[0], argv._[1]);
break; break;
default: default:
if (2 === argv._.length) { if (2 === argv._.length) {
console.log(chalk.dim(`> Running \`now alias set ${argv[0]} ${argv[1]}\``)); console.log(chalk.dim(`> Running \`now alias set ${argv._[0]} ${argv._[1]}\``));
await alias.set(url, alias); await alias.set(argv._[0], argv._[1]);
} else if (argv._.length >= 3) { } else if (argv._.length >= 3) {
error('Invalid number of arguments'); error('Invalid number of arguments');
help(); help();

Loading…
Cancel
Save