@zhennann/common-bin 2.9.5 → 2.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/command.js +8 -4
  2. package/package.json +1 -1
package/lib/command.js CHANGED
@@ -205,15 +205,19 @@ class CommonBin {
205
205
  */
206
206
  * [DISPATCH]() {
207
207
  // define --help and --version by default
208
- this.yargs
208
+ const _yargs = this.yargs
209
209
  // .reset()
210
- .completion()
210
+ .completion('completion', false)
211
211
  .help()
212
212
  .version()
213
213
  .wrap(80)
214
214
  .alias('h', 'help')
215
- .alias('v', 'version')
216
- .group([ 'help', 'version' ], 'Global Options:');
215
+ .alias('v', 'version');
216
+ if (this.constructor.name === 'CliCommand') {
217
+ _yargs.alias('t', 'token').group(['help', 'version', 'token'], 'Global Options:');
218
+ } else {
219
+ _yargs.group(['help', 'version'], 'Global Options:');
220
+ }
217
221
 
218
222
  // get parsed argument without handling helper and version
219
223
  const parsed = yield this[PARSE](this.rawArgv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhennann/common-bin",
3
- "version": "2.9.5",
3
+ "version": "2.9.8",
4
4
  "description": "Abstraction bin tool",
5
5
  "main": "index.js",
6
6
  "dependencies": {