diff --git a/command/completions/_zsh_completions_generator.ts b/command/completions/_zsh_completions_generator.ts index 3cddac0f..61ac1f33 100644 --- a/command/completions/_zsh_completions_generator.ts +++ b/command/completions/_zsh_completions_generator.ts @@ -154,11 +154,12 @@ function _${replaceSpecialChars(path)}() {` + if (command.hasCommands(false)) { const actions: string = command .getCommands(false) - .map((command: Command) => - `${command.getName()}) _${ - replaceSpecialChars(path + " " + command.getName()) - } ;;` - ) + .map((command: Command) => { + const aliases = [command.getName(), ...command.getAliases()] + .join("|"); + const action = replaceSpecialChars(path + " " + command.getName()); + return `${aliases}) _${action} ;;`; + }) .join("\n "); return `\n @@ -187,7 +188,6 @@ function _${replaceSpecialChars(path)}() {` + if (command.hasArguments() || command.hasCommands(false)) { argsCommand += ` \\\n '${++argIndex}:command:_commands'`; - const args: string[] = []; // first argument is completed together with commands.