From 8eaf0329f870985139b88387d622e618252dc354 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 7 Jul 2021 13:30:50 +0200 Subject: [PATCH] disable `completion` command Disable the implicit `completion` command that cobra 1.2.x added. Signed-off-by: Valentin Rothberg --- cmd/skopeo/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/skopeo/main.go b/cmd/skopeo/main.go index 670260e0..f2a61bc4 100644 --- a/cmd/skopeo/main.go +++ b/cmd/skopeo/main.go @@ -102,6 +102,11 @@ func main() { return } rootCmd, _ := createApp() + // Currently, skopeo uses manually written completions. Cobra allows + // for auto-generating completions for various shells. Podman is + // already making us of that. If Skopeo decides to follow, please + // remove the line below (and hide the `completion` command). + rootCmd.CompletionOptions.DisableDefaultCmd = true if err := rootCmd.Execute(); err != nil { logrus.Fatal(err) }