-
Notifications
You must be signed in to change notification settings - Fork 107
fix(cli): fail fast on unknown config flags #690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): fail fast on unknown config flags #690
Conversation
Previously, the OM CLI would silently ignore unknown arguments when parsing config-related flags due to the use of flags.IgnoreUnknown in loadConfigFile. This could lead to user mistakes going unnoticed. This change removes flags.IgnoreUnknown and uses strict parsing for config flags, ensuring that any unknown or misspelled config-related arguments cause the CLI to fail fast with a helpful error message. This improves user feedback and prevents misconfiguration due to typos or unsupported flags. Signed-off-by: Sanjit Mohanty <[email protected]>
|
With the command |
@drich10, it was a misunderstanding on my part regarding the problem. Thank you for helping me understand the problem statement. I’ve pushed a new changeset with the intention of fixing this issue now. Could you please review this new changeset? |
e4a4e59 to
a66af94
Compare
Signed-off-by: Sanjit Mohanty <[email protected]>
a66af94 to
0879e8d
Compare
Signed-off-by: Sanjit Mohanty <[email protected]>
e463034 to
b91bc88
Compare
drich10
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks pretty good! Two things:
- I'd just like to see the test moved to the acceptance suite and tie the tests to some of the existing commands to tie the tests to the currently supported interface
- Can you explain the reasoning for the stderr printing on top of the error return? Its a departure from the output that occurs currently when a flag is incorrectly specified.
7d3033c to
5f4653c
Compare
Thanks @drich10 for the review! I've addressed both the review comments now. PTAL & let me know if it looks good to merge now. |
Signed-off-by: Sanjit Mohanty <[email protected]>
5f4653c to
7e0813c
Compare
drich10
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fast changes and improved commentary on the sticky bits. Last change w.r.t logging and program control flow.
Signed-off-by: Sanjit Mohanty <[email protected]>
drich10
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes and looks good to me!

Previously, the OM CLI would silently ignore unknown arguments when parsing config-related flags due to the use of
flags.IgnoreUnknownin loadConfigFile. This could lead to user mistakes going unnoticed.This change removes
flags.IgnoreUnknownand uses strict parsing for config flags, ensuring that any unknown or misspelled config-related arguments cause the CLI to fail fast with a helpful error message.This improves user feedback and prevents misconfiguration due to typos or unsupported flags.