qq.js 547 B

1234567891011121314151617
  1. const run = require('./test/util').run;
  2. // run(cmd => cmd.arg().name('qwe').end().arg().name('zxc').end().act(function(opts, args) { console.log({opts, args}); }), ['qwe', 'zxc']) // cmd and args
  3. // .then(res => {
  4. // // code
  5. // // stdout
  6. // // stderr
  7. // console.log(res);
  8. // });
  9. run(cmd => cmd.opt().name('version').short('v').only().flag().act((opts) => { return 'aasd'; }), ['-v']) // cmd and args
  10. .then(res => {
  11. // code
  12. // stdout
  13. // stderr
  14. console.log(res);
  15. });