Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. |- build
  2. | |- browser (+ options)
  3. | |- cordova (+ options)
  4. | |- no subcommands, just options
  5. |- config
  6. | |- create (+ options)
  7.  
  8. program.command('browser').description(...);
  9. program.command('cordova').description(...);
  10. program.option(...);
  11.  
  12. program.command('create').description(...);
  13.  
  14. const commander = require('commander');
  15. const program = new commander.Command();
  16. program
  17. .command('build', 'build description')
  18. .command('config', 'config description')
  19. .parse(process.argv);
  20.  
  21. const commander = require('commander');
  22. const program = new commander.Command();
  23. program
  24. .command('create')
  25. .description('create description')
  26. .action(() => {
  27. console.log('Called create');
  28. });
  29. program.parse(process.argv);
  30.  
  31. $ node pm.js config create
  32. Called create
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement