Skip to content
Myr

resolves #739 add parent command as prefix of subcommand

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

authored by Dan Allen · committed by Dan Allen · parent fefda77 · Browse files · 2 files+12 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+12 added−1 removed

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

2 files+12 added−1 removed

added:test/test.command.usage.js+8 added
modified:index.js+4 added-1 removed
1029 unmodified lines
1030 var cmdName = this._name;1031 if (this._alias) {1032 cmdName = cmdName + '|' + this._alias;1033 }1034 var ancestor = this1035 var prefix = []1036 while ((ancestor = ancestor.parent)) prefix.push(ancestor.name() + ' ')1037 var usage = [1038 ''1036 ,' Usage: ' + cmdName + ' ' + this.usage()1039 ,' Usage: ' + prefix.join('') + cmdName + ' ' + this.usage()1040 , ''1041 ];10421043 var cmds = [];
118 unmodified lines