diff --git a/dist/cli/use.txt b/dist/cli/help/use.txt similarity index 100% rename from dist/cli/use.txt rename to dist/cli/help/use.txt diff --git a/dist/cli/main.js b/dist/cli/main.js index b730320..6072e3d 100644 --- a/dist/cli/main.js +++ b/dist/cli/main.js @@ -92,15 +92,11 @@ Definition of the `main` function. x = splitSrcDest.call(this); execute.call(this, x.src, x.dst, this.opts(), logMsg); }); - program.command('help')["arguments"]('[command]').description('Get help on a HackMyResume command').action(function(command) { - var cmd, manPage; - cmd = command && command.trim(); - if (cmd) { - manPage = FS.readFileSync(PATH.join(__dirname, 'help/' + cmd + '.txt'), 'utf8'); - } else { - manPage = FS.readFileSync(PATH.join(__dirname, 'use.txt'), 'utf8'); - } - console.log(M2C(manPage, 'white', 'yellow.bold')); + program.command('help')["arguments"]('[command]').description('Get help on a HackMyResume command').action(function(cmd) { + var manPage; + cmd = cmd || 'use'; + manPage = FS.readFileSync(PATH.join(__dirname, 'help/' + cmd + '.txt'), 'utf8'); + _out.log(M2C(manPage, 'white', 'yellow.bold')); }); program.parse(args); if (!program.args.length) { @@ -161,7 +157,7 @@ Definition of the `main` function. }; Command.prototype.helpInformation = function() { var manPage; - manPage = FS.readFileSync(PATH.join(__dirname, 'use.txt'), 'utf8'); + manPage = FS.readFileSync(PATH.join(__dirname, 'help/use.txt'), 'utf8'); return M2C(manPage, 'white', 'yellow'); }; return { diff --git a/src/cli/use.txt b/src/cli/help/use.txt similarity index 100% rename from src/cli/use.txt rename to src/cli/help/use.txt diff --git a/src/cli/main.coffee b/src/cli/main.coffee index 156672c..ffe7a65 100644 --- a/src/cli/main.coffee +++ b/src/cli/main.coffee @@ -137,15 +137,12 @@ main = module.exports = ( rawArgs, exitCallback ) -> .command('help') .arguments('[command]') .description('Get help on a HackMyResume command') - .action ( command ) -> - cmd = command && command.trim() - if cmd - manPage = FS.readFileSync( - PATH.join(__dirname, 'help/' + cmd + '.txt'), 'utf8' ) - else - manPage = FS.readFileSync( - PATH.join(__dirname, 'use.txt'), 'utf8' ) - console.log M2C(manPage, 'white', 'yellow.bold') + .action ( cmd ) -> + cmd = cmd || 'use' + manPage = FS.readFileSync( + PATH.join(__dirname, 'help/' + cmd + '.txt'), + 'utf8') + _out.log M2C(manPage, 'white', 'yellow.bold') return program.parse( args ) @@ -204,7 +201,7 @@ initialize = ( ar, exitCallback ) -> # Override the .helpInformation behavior Command.prototype.helpInformation = -> manPage = FS.readFileSync( - PATH.join(__dirname, 'use.txt'), 'utf8' ) + PATH.join(__dirname, 'help/use.txt'), 'utf8' ) return M2C(manPage, 'white', 'yellow') return {