From d518ebaec6373867e9250f9ab4582a5e7a54da7b Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Tue, 27 Feb 2024 13:04:54 +0100 Subject: [PATCH] move more stuff around --- cmd/root.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 2e3a2f9..9b68713 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -67,8 +67,6 @@ func NewRootCommand() (*cobra.Command) { root.AddCommand(groups.NewCommand()) root.AddCommand(json.NewCommand()) - root.PersistentFlags().StringP("file", "f", ".env", "Load this file") - return root } @@ -80,6 +78,7 @@ func RunCommand(ctx context.Context, args []string, stdout io.Writer, stderr io. root.SetContext(ctx) root.SetErr(stderr) root.SetOut(stdout) + root.PersistentFlags().StringP("file", "f", ".env", "Load this file") root.SetVersionTemplate(`{{ .Version }}`) command, err := root.ExecuteC()