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

Function makeHeatCommand

examples/nestedCommands.js:21–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19// Add nested commands using `.addCommand().
20// The command could be created separately in another module.
21function makeHeatCommand() {
22 const heat = new Command('heat');
23 heat.command('jug').action(() => {
24 console.log('heat jug');
25 });
26 heat.command('pot').action(() => {
27 console.log('heat pot');
28 });
29 return heat;
30}
31program.addCommand(makeHeatCommand());
32
33program.parse(process.argv);

Callers 1

nestedCommands.jsFile · 0.85

Calls 2

commandMethod · 0.95
actionMethod · 0.80

Tested by

no test coverage detected