Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |- build
- | |- browser (+ options)
- | |- cordova (+ options)
- | |- no subcommands, just options
- |- config
- | |- create (+ options)
- program.command('browser').description(...);
- program.command('cordova').description(...);
- program.option(...);
- program.command('create').description(...);
- const commander = require('commander');
- const program = new commander.Command();
- program
- .command('build', 'build description')
- .command('config', 'config description')
- .parse(process.argv);
- const commander = require('commander');
- const program = new commander.Command();
- program
- .command('create')
- .description('create description')
- .action(() => {
- console.log('Called create');
- });
- program.parse(process.argv);
- $ node pm.js config create
- Called create
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement