Created
May 12, 2020 05:59
-
-
Save mh-mobile/798336824d5b3c36b4838edfff68b2c0 to your computer and use it in GitHub Desktop.
This file contains 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
require("yargs") | |
.scriptName("console") | |
.usage("$0 <cmd> [args]") | |
.command( | |
"hello [name]", | |
"console your name!", | |
(yargs) => { | |
yargs.positional("name", { | |
type: "string", | |
default: "mh-mobile", | |
describe: "the name to say hello to", | |
}); | |
}, | |
function (argv) { | |
console.log("hello", argv.name, "welcome to yargs!"); | |
} | |
) | |
.help().argv; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment