From fdb3bc544bc1852b3cad791946a5a8147f70e24f Mon Sep 17 00:00:00 2001 From: Yannik Daellenbach Date: Thu, 30 May 2024 16:50:30 +0200 Subject: [PATCH] Make "binary" flag persistent --- cmd/kustomize.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/kustomize.go b/cmd/kustomize.go index ef95df5..3c6274c 100644 --- a/cmd/kustomize.go +++ b/cmd/kustomize.go @@ -46,10 +46,10 @@ var kustomizeCmd = &cobra.Command{ } func init() { - kustomizeCmd.AddCommand(kustomize.KustomizeBuildCmd) - rootCmd.AddCommand(kustomizeCmd) - - binary = kustomizeCmd.Flags().String("binary", "", "Alternative kustomize binary") + binary = kustomizeCmd.PersistentFlags().String("binary", "", "Alternative kustomize binary") version = kustomizeCmd.Flags().BoolP("version", "v", false, "Display version of kustomize") outputDotDir = kustomizeCmd.Flags().StringP("output-dir", "o", ".", "Output directory") + + kustomizeCmd.AddCommand(kustomize.KustomizeBuildCmd) + rootCmd.AddCommand(kustomizeCmd) }