Skip to content

Commit

Permalink
Remove completion generation command
Browse files Browse the repository at this point in the history
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
  • Loading branch information
ulyssessouza committed Sep 19, 2022
1 parent cd5173b commit 593d252
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
24 changes: 0 additions & 24 deletions cmd/compose/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,12 @@
package compose

import (
"os"
"strings"

"github.com/docker/compose/v2/pkg/api"
"github.com/spf13/cobra"
)

var completionCmd = &cobra.Command{
Use: "completion [bash|zsh|fish|powershell]",
Short: "Generate completion script",
Long: `To load completions run:
$ docker compose completion [bash|zsh|fish|powershell] | source`,
DisableFlagsInUseLine: true,
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
Args: cobra.ExactValidArgs(1),
Run: func(cmd *cobra.Command, args []string) {
switch args[0] {
case "bash":
cmd.Root().GenBashCompletion(os.Stdout) //nolint:errcheck
case "zsh":
cmd.Root().GenZshCompletion(os.Stdout) //nolint:errcheck
case "fish":
cmd.Root().GenFishCompletion(os.Stdout, true) //nolint:errcheck
case "powershell":
cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) //nolint:errcheck
}
},
}

// validArgsFn defines a completion func to be returned to fetch completion options
type validArgsFn func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

Expand Down
1 change: 0 additions & 1 deletion cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command {
pullCommand(&opts, backend),
createCommand(&opts, backend),
copyCommand(&opts, backend),
completionCmd,
)
c.Flags().SetInterspersed(false)
opts.addProjectFlags(c.Flags())
Expand Down

0 comments on commit 593d252

Please sign in to comment.