Setup subcommands with yargs

This commit is contained in:
2022-04-25 15:18:12 +05:30
committed by Ashwin Phatak
parent f931625103
commit 977d9a8ffa
8 changed files with 296 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import yargs, { Arguments } from 'yargs';
export const command = 'start';
export const desc = 'Start local CNS.';
exports.builder = {
'log-file': {
type: 'string'
}
}
exports.handler = function (argv: Arguments) {
const { logFile } = argv;
console.log('option logFile', logFile)
}
+9
View File
@@ -0,0 +1,9 @@
import yargs from 'yargs';
export const command = 'cns';
export const desc = 'CNS tools';
exports.builder = (yargs: yargs.Argv) => {
return yargs.commandDir('cns-cmds')
}