Skip to content

Commit

Permalink
Allow unknown flags
Browse files Browse the repository at this point in the history
  • Loading branch information
snovichkov committed Apr 13, 2023
1 parent af68910 commit cf75e2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (b *Bundle) provideViper(ctx context.Context, flagSet *pflag.FlagSet) (_ *v
func (b *Bundle) provideFlagSet() (*pflag.FlagSet, error) {
var flagSet = pflag.NewFlagSet(BundleName, pflag.ContinueOnError)
flagSet.StringP("config", "c", "", "config file")
flagSet.ParseErrorsWhitelist.UnknownFlags = true

var err = flagSet.Parse(os.Args)
if errors.Is(err, pflag.ErrHelp) {
Expand Down

0 comments on commit cf75e2a

Please sign in to comment.