Skip to content

Commit

Permalink
parse flags after initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonTheLeg committed Sep 7, 2024
1 parent 363e751 commit 8dcb34e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"flag"
"io"

"github.com/simontheleg/konf-go/config"
Expand Down Expand Up @@ -31,6 +32,7 @@ Afterwards switch between different kubeconfigs via 'konf set'
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() error {
initPersistentFlags()
flag.Parse()

if err := initConfig(); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion testhelper/shellwrapper.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This script tests the compatibility of the konf-go shellwrappe with different shells
# This script tests the compatibility of the konf-go shellwrapper with different shells
# Therefore it has no shebang line and is intended to be executed directly by the shell to test

set -o errexit
Expand Down

0 comments on commit 8dcb34e

Please sign in to comment.