I am using yargs to build a command line application with node.
One of my commands are as follows:
exports.command = 'website <type> <url> [prod]'
exports.aliases = ['w']
exports.desc =
'create new website with type <type> at url <url> for production [prod]'
exports.builder = {}
exports.handler = function(argv) {
}
This works fine and I can run a command such as
website html https://example.com production
How can I give aliases to my optional or positional arguments, so that I can do something like this :
website --type html --url https://example.com --prod production
or even
website -t html -u https://example.com -p production
Also, when can I use double -- and when should I use single - . I have read the documentation here https://github.com/yargs/yargs/blob/master/docs/advanced.md but they don't go into detail on how to do this when using a modular command directory structure.
Please help