Repository navigation
feat(cli): show the --fields default in command help - #160
Merged
2 commits merged intoNov 3, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
`parse`, `search`, and `watch` accept `--fields` but the help never said
which fields are printed when the option is omitted. The default is
rendered as a delta against the available fields ("all fields except ...")
because clap does not wrap help text, so repeating the default list would
add a several-hundred-character line to `--help`.
`watch --fields` now lists the available fields as well, since it shares
the parse defaults.
There was a problem hiding this comment.
🟡 Changes recommended
The parse/watch documentation incorrectly says JSON output excludes fields retained by native serialization, requiring clarification and corresponding updates to help assertions and the README sample.
1 open issue
What changed in this PR
This PR addresses #159 by documenting command-specific --fields defaults in CLI help, using compact exclusion lists instead of repeating every default field.
Changes:
- Show field defaults for
parse,search, andwatch, and add available fields to watch help. - Add tests for default summaries and help-line length.
- Refresh README help samples for
parseandsearch.
| File | Description |
|---|---|
src/bin/commands/watch.rs |
Use shared field help with parse defaults. |
src/bin/commands/search.rs |
Supply search defaults to the help generator. |
src/bin/commands/parse.rs |
Supply parse defaults to the help generator. |
src/bin/commands/elem_format.rs |
Generate compact default summaries and add tests. |
README.md |
Update available fields and default descriptions in help samples. |
Review effort: Balanced
`parse` and `watch` emit the native element fields for JSON output when the default field set is selected, so the default line alone was inaccurate for those two commands. `search` projects the field list, so its help is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #159.
--fieldsnow states its default:Default: all fields except path_id, origin_asns, only-to-customerforsearch, pluscollectorforparseandwatch. The delta form is deliberate. clap does not wrap help text here, so repeating the 14 and 15 default field names would add a 400-character line to--help.monocle watch --fieldsnow lists the available fields too, since it shares the parse defaults.monocle rib --fieldskeeps its own field set and is unchanged.Updated the README help samples for
parseandsearch.