Skip to content

Commit

Permalink
Add auto completion support for fish and power shell
Browse files Browse the repository at this point in the history
  • Loading branch information
dvob committed Jun 25, 2020
1 parent 8623c2c commit c64be72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/pcert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func newCompletionCmd() *cobra.Command {
var shell string
cmd := &cobra.Command{
Use: "completion <shell>",
ValidArgs: []string{"bash", "zsh"},
ValidArgs: []string{"bash", "zsh", "fish", "ps"},
Args: cobra.ExactArgs(1),
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -99,6 +99,10 @@ func newCompletionCmd() *cobra.Command {
err = newRootCmd().GenBashCompletion(os.Stdout)
case "zsh":
err = newRootCmd().GenZshCompletion(os.Stdout)
case "fish":
err = newRootCmd().GenFishCompletion(os.Stdout, true)
case "ps":
err = newRootCmd().GenPowerShellCompletion(os.Stdout)
default:
err = fmt.Errorf("unknown shell: %s", shell)
}
Expand Down

0 comments on commit c64be72

Please sign in to comment.