Skip to content

Commit

Permalink
Fix the bug where an error was being hidden by a potentially valid fl…
Browse files Browse the repository at this point in the history
…ag not being recognized by the root command

Signed-off-by: Adrian Orive <adrian.orive.oneca@gmail.com>
  • Loading branch information
Adirio committed Feb 17, 2021
1 parent 7adcffd commit e23cbe4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func (c cli) newRootCmd() *cobra.Command {
fs.String(projectVersionFlag, "", "project version")
fs.StringSlice(pluginsFlag, nil, "plugin keys of the plugin to initialize the project with")

// As the root command will be used to shot the help message under some error conditions,
// like during plugin resolving, we need to allow unknown flags to prevent parsing errors.
cmd.FParseErrWhitelist = cobra.FParseErrWhitelist{UnknownFlags: true}

return cmd
}

Expand Down

0 comments on commit e23cbe4

Please sign in to comment.