diff --git a/cmsc388b/code_along/weather/cmds/help.js b/cmsc388b/code_along/weather/cmds/help.js index 5ab2f4e36024b87fd9293998d34cd6776df1c5e7..b300681700281b06127e6a114ad4641d9f227b52 100644 --- a/cmsc388b/code_along/weather/cmds/help.js +++ b/cmsc388b/code_along/weather/cmds/help.js @@ -13,9 +13,9 @@ const menus = { } module.exports = (args) => { - const subCmd = args._[0] === 'help' - ? args._[1] - : args._[0] - + console.log("***********") + console.log(args._[0]) + const subCmd = args._[0] === 'help' ? args._[1] : args._[0] + console.log(subCmd) console.log(menus[subCmd] || menus.main) } \ No newline at end of file diff --git a/cmsc388b/code_along/weather/index.js b/cmsc388b/code_along/weather/index.js index 40ba40a1243ca4c1a1ba515d613b5cff39a74f30..eca25084775e90f63a5efd0ab01d325457eb2a85 100644 --- a/cmsc388b/code_along/weather/index.js +++ b/cmsc388b/code_along/weather/index.js @@ -2,8 +2,18 @@ const minimist = require('minimist') module.exports = () => { const args = minimist(process.argv.slice(2)) - //console.log(args); - const cmd = args._[0] + console.log("args is: "); + console.log(args); + let cmd = args._[0] || 'help' + + if (args.version || args.v) { + cmd = 'version' + } + + if (args.help || args.h) { + cmd = 'help' + } + console.log("------------") console.log(cmd); switch (cmd) { case 'today':