Skip to content

Commit

Permalink
add WithIgnoreUndefined option to config parse
Browse files Browse the repository at this point in the history
  • Loading branch information
zackattack01 committed Aug 16, 2024
1 parent c48ff7c commit 092963e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/launcher/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
ffOpts := []ff.Option{
ff.WithConfigFileFlag("config"),
ff.WithConfigFileParser(ff.PlainParser),
ff.WithIgnoreUndefined(true), // silently discard any unknown options and keep parsing
}

// Windows doesn't really support environmental variables in quite
Expand All @@ -290,6 +291,9 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
ffOpts = append(ffOpts, ff.WithEnvVarPrefix("KOLIDE_LAUNCHER"))
}

// TODO for discussion - i suspect with WithIgnoreUndefined set we could
// check for and return errors here and that would be less confusing if there
// are ever other parsing issues. Currently we would have no idea
ff.Parse(flagset, args, ffOpts...)

// handle --version
Expand Down

0 comments on commit 092963e

Please sign in to comment.