cloud-red
Version:
Harnessing Serverless for your cloud integration needs
38 lines (31 loc) • 832 B
JavaScript
const chalk = require('chalk');
const USAGE = chalk.yellow('USAGE:');
const COMMANDS = chalk.yellow('COMMANDS:');
const ARGS = chalk.yellow('ARGS:');
const menus = {
main: `
${USAGE}
cloud-red [command] <options>
${COMMANDS}
init ............. bootstrap a new lambda project
open ............. open the editor (default command)
version .......... show the cli version
help ............. show the help menu for a command
`,
init: `
${USAGE}
cloud-red init [ARGS]
${ARGS}
<name> ........... name of the project
`,
open: `
${USAGE}
cloud-red open [ARGS]
${ARGS}
<directory> ...... (optional) directory to scan for flow files
`
};
module.exports = args => {
const subCmd = args._[0] === 'help' ? args._[1] : args._[0];
console.log(menus[subCmd] || menus.main);
};