项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

18 lines
547 B

  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. });