Created
May 17, 2016 13:23
-
-
Save andrewjmead/0cf7c0f7bc484d32c54b0e559941e3c5 to your computer and use it in GitHub Desktop.
Yargs 4.x.x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var argv = require('yargs') | |
.command('Hello', 'Greets the User', function(yargs){ | |
return yargs.options({ | |
name: { | |
demand: true | |
} | |
}); | |
}) | |
.argv; | |
var command = argv._[0]; | |
if (command === 'hello' && typeof argv.name !== 'undefined'){ | |
console.log('Hello '+ argv.name +' '+ argv.lastName); | |
}// end if | |
else if (command === 'hello'){ | |
console.log('hello world!'); | |
}// end else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your website doesn't work