Open mappum opened 8 years ago
Good suggestion ;)
:+1: :D
:+1:
Looked into implementing this tonight. From my understanding a program stores commands as a name => path.js
set and then lazy loads the command from the path if it matches. The lazy loading prevents reading in any command props like command.aliases: ['myalias', 'other alias']
etc.
To keep lazy loading of commands it would either require: a) command aliases to be defined at a program level e.g.:
var ronin = require('ronin');
var program = ronin({
path: __dirname,
aliases: {'alias': 'command'},
desc: 'Sample for implementing command aliases'
});
program.run();
b) default to loading all commands and then unwinding aliases if the lazy loading technique fails.
Don't worry guys, I will get to it ASAP. Ronin needs a complete rewrite anyway.
Ronin supports aliases for options, but not for commands. This would be a nice feature, since it can save a lot of typing for power users (e.g.
npm i
vsnpm install
). The convention used for options could be used (alias: 'foo'
andaliases: [ 'foo', 'bar' ]
).