1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-07-09 11:41:07 +01:00

Add formal support for aliases.

new/create and build/generate
This commit is contained in:
hacksalot
2015-12-30 13:00:30 -05:00
parent e3cb949992
commit 1bcc2f7d0c
2 changed files with 14 additions and 10 deletions

View File

@ -55,7 +55,7 @@ function main() {
// Get the action to be performed
var params = a._.map( function(p){ return p.toLowerCase().trim(); });
var verb = params[0];
if( !FCMD.verbs[ verb ] ) {
if( !FCMD.verbs[ verb ] && !FCMD.alias[ verb ] ) {
logMsg('Invalid command: "'.warn + verb.warn.bold + '"'.warn);
return;
}
@ -76,7 +76,7 @@ function main() {
( splitAt === -1 ) && src.length > 1 && dst.push( src.pop() ); // Allow omitting TO keyword
// Invoke the action
FCMD.verbs[ verb ].apply( null, [ src, dst, opts, logMsg ] );
(FCMD.verbs[verb] || FCMD.alias[verb]).apply(null, [src, dst, opts, logMsg]);
}