diff --git a/lib/usage.ts b/lib/usage.ts index 1426c4337..9374d2d16 100644 --- a/lib/usage.ts +++ b/lib/usage.ts @@ -246,8 +246,10 @@ export function usage(yargs: YargsInstance, shim: PlatformShim) { commands = commands.sort((a, b) => a[0].localeCompare(b[0])); } + const prefix = base$0 ? `${base$0} ` : ''; + commands.forEach(command => { - const commandString = `${base$0} ${parentCommands}${command[0].replace( + const commandString = `${prefix}${parentCommands}${command[0].replace( /^\$0 ?/, '' )}`; // drop $0 from default commands.