-
Notifications
You must be signed in to change notification settings - Fork 287
client: add examples, short flags and better error handling #2349
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
Conversation
- Add usage examples to export and compat commands - Add `-p` short flag for `--path` option - Silence usage output on runtime errors for cleaner error messages Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@est.tech>
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
marquiz
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 @fmuyassarov for the enhancement, looks good to me
|
/cc @ArangoGutierrez |
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.
Pull Request Overview
This PR enhances CLI usability by adding usage examples to subcommands and improving error handling. The changes include setting SilenceUsage = true on the root command to prevent double output on errors, adding example sections to three commands (features, labels, and validate-node), and adding shorthand -p flags to the --path options for better ergonomics.
- Suppresses usage output on command errors via
RootCmd.SilenceUsage = true - Adds example documentation to export and validation commands
- Adds shorthand
-pflag for--pathoption in export commands
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/nfd/subcmd/root.go | Sets SilenceUsage to prevent usage output on errors |
| cmd/nfd/subcmd/export/labels.go | Adds example documentation and shorthand flag for path option |
| cmd/nfd/subcmd/export/features.go | Adds example documentation and shorthand flag for path option |
| cmd/nfd/subcmd/compat/validate-node.go | Adds example documentation for validation command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| nfd export features | ||
| # Export node labels to a file instead | ||
| nfd export features --path /tmp/labels.json` |
Copilot
AI
Nov 10, 2025
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.
The example text shows 'nfd export features' but this is the 'labels' command. The examples should use 'nfd export labels' instead to match the command being documented.
| nfd export features | |
| # Export node labels to a file instead | |
| nfd export features --path /tmp/labels.json` | |
| nfd export labels | |
| # Export node labels to a file instead | |
| nfd export labels --path /tmp/labels.json` |
ArangoGutierrez
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.
/lgtm
|
LGTM label has been added. Git tree hash: 46937a65abc1648f390ea038cd9cea4b355967f3
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ArangoGutierrez, fmuyassarov, marquiz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Improve user experience.
-pshort flag for--pathoptionExamples
Usage silencing (before)
after
before
after
Helper examples: