Skip to content

Commit b46beea

Browse files
authored
Merge pull request #2023 from Adirio/fix-hidden-error
🐛 Fix the bug where an error was being hidden by a potentially valid flag not being recognized by the root command
2 parents 7adcffd + e23cbe4 commit b46beea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cli/root.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ func (c cli) newRootCmd() *cobra.Command {
4949
fs.String(projectVersionFlag, "", "project version")
5050
fs.StringSlice(pluginsFlag, nil, "plugin keys of the plugin to initialize the project with")
5151

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

0 commit comments

Comments
 (0)