example:
const{ flag, output }=require('@alanchenchen/commandlineflag');constprogram=flag();constdoc=output();program.option('-c | --config','set config source path',({ index, param},args)=>{console.log('index',index);console.log('param',param);console.log('args',args);}).option('-h | --help',()=>{doc.render(true);}).version(require('../package').version).run();next, input command in terminal
$ ssh-deploy -h
Usage: flag <command> [options]
ssh-deploy CLI
Options:
-V, --version output the version number
-h, --help output usage information
-c | --config set config file path
option '-c | --config' is not good, it should be '-c , --config'.
example:
next, input command in terminal
option '-c | --config' is not good, it should be '-c , --config'.