How to use the usage function from commander

Find comprehensive JavaScript commander.usage code examples handpicked from public code repositorys.

73
74
75
76
77
78
79
if (commander.transform) {
  include(commander.include);
  exclude(commander.exclude);
  transform(commander.transform);
} else {
  console.error('Usage: ' + commander.usage());
}
fork icon1
star icon7
watch icon4

+ 9 other calls in file

9
10
11
12
13
14
15
16
17
18
if (first === '-v' || first === '--version' || first === '-V') {
  cml.log.notice(`current running chameleon(${cml.root})`)
  version();
} else {
  let extCommand = require('../commanders/ext/index.js').name;
  commander.usage('[command] [options]')
  commander.version(`${cmlpackage.name}@${cmlpackage.version}`)
  let cmdList = ['init', 'dev', 'build', 'server', 'web', 'weex', 'wx', 'baidu', 'alipay', 'qq', 'tt','info'];
  if (typeof extCommand === 'string') {
    cmdList.push('ext');
fork icon700
star icon0
watch icon239

+ 19 other calls in file

30
31
32
33
34
35
36
37
38
39
        cmd.option(op.flags, op.description, op.defaultValue)
      })
    }
    cmd.action(handle)
  })
  commander.usage(commandNames.join('/') + ' [options]')
}

exports.command = function(args) {
  loadCommands()
fork icon8
star icon61
watch icon8

40
41
42
43
44
45
46
47
48
49
50
51




function runQuery(file, token) {
    if(typeof file === undefined || typeof token === undefined)
    {
        console.log('Usage: ./index.js ' + program.usage());
        process.exit(1);
    }
    try {
        var queryText = fs.readFileSync(file, "utf8");
fork icon0
star icon1
watch icon1

+ 4 other calls in file

Other functions in commander

Sorted by popularity

function icon

commander.Option is the most popular function in commander (1786 examples)