Skip to content
Myr

Merge pull request #980 from shadowspawn/feature/739-command-prefix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add parent command as prefix of subcommand

authored by John Gee · committed by GitHub · parents ff156f0, 5eefd9e · Browse files · 2 files+13 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+13 added−1 removed

  • tests:+8 added−0 removed
  • other:+5 added−1 removed

2 files+13 added−1 removed

added:test/test.command.usage.js+8 added
modified:index.js+5 added-1 removed
1114 unmodified lines
1115 var cmdName = this._name;1116 if (this._alias) {1117 cmdName = cmdName + '|' + this._alias;1118 }1119 var parentCmdNames = '';1120 for (var parentCmd = this.parent; parentCmd; parentCmd = parentCmd.parent) {1121 parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;1122 }1123 var usage = [1120 'Usage: ' + cmdName + ' ' + this.usage(),1124 'Usage: ' + parentCmdNames + cmdName + ' ' + this.usage(),1125 ''1126 ];11271128 var cmds = [];
119 unmodified lines