| 63 | ` |
| 64 | |
| 65 | func buildCompletionCommand(appName string) *Command { |
| 66 | cmd := &Command{ |
| 67 | Name: completionCommandName, |
| 68 | Hidden: true, |
| 69 | Usage: "Output shell completion script for bash, zsh, fish, or Powershell", |
| 70 | Description: strings.ReplaceAll(completionDescription, "$COMMAND", appName), |
| 71 | isCompletionCommand: true, |
| 72 | } |
| 73 | |
| 74 | for _, shell := range completionShells { |
| 75 | cmd.Commands = append(cmd.Commands, buildShellCompletionSubcommand(shell, shellCompletions[shell], appName)) |
| 76 | } |
| 77 | |
| 78 | return cmd |
| 79 | } |
| 80 | |
| 81 | func buildShellCompletionSubcommand(shell string, render renderCompletion, appName string) *Command { |
| 82 | return &Command{ |