refactor(commands): commands now store all info about themselves

Makes it easier to modify a command

Each command exports an object:
{
  directive: string or array of commands that call this handler
  handler: function to process the command
  syntax: string of how to call the command
  description: human readable explaination of command
  flags: optional object of flags
}
This commit is contained in:
Tyler Stewart
2017-03-08 12:31:44 -07:00
parent f6d1a3828a
commit 795c3d7c65
84 changed files with 769 additions and 708 deletions

View File

@@ -0,0 +1,11 @@
const cwd = require('./cwd').handler;
module.exports = {
directive: ['CDUP', 'XCUP'],
handler: function(args) {
args.command._ = [args.command._[0], '..'];
return cwd.call(this, args);
},
syntax: '{{cmd}}',
description: 'Change to Parent Directory'
}