MCPcopy
hub / github.com/tj/commander.js / createProgram

Function createProgram

tests/command.parseOptions.test.js:58–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57describe('Command.parseOptions()', () => {
58 function createProgram() {
59 const program = new commander.Command();
60 program
61 .option('--global-flag')
62 .option('--global-value <value>')
63 .command('sub [args...]')
64 .option('--sub-flag');
65 program.action(() => {});
66 return program;
67 }
68
69 // Subcommands are just another potential operand as far as parseOptions is concerned, so limited testing of subcommand as such.
70

Callers 1

Calls 3

optionMethod · 0.95
actionMethod · 0.95
commandMethod · 0.80

Tested by

no test coverage detected