Skip to content

feat(cli): show the --fields default in command help - #160

Merged
2 commits merged into
mainfrom
cli-fields-help-default
Nov 3, 2026
Merged

2 commits merged into
mainfrom
cli-fields-help-default

Conversation

@digizeph

@digizeph digizeph commented Nov 3, 2026

Copy link
Copy Markdown
Member

Closes #159.

--fields now states its default: Default: all fields except path_id, origin_asns, only-to-customer for search, plus collector for parse and watch. 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 --fields now lists the available fields too, since it shares the parse defaults. monocle rib --fields keeps its own field set and is unchanged.

Updated the README help samples for parse and search.

`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.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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, and watch, and add available fields to watch help.
  • Add tests for default summaries and help-line length.
  • Refresh README help samples for parse and search.
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

Comment thread src/bin/commands/elem_format.rs Resolved
`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.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the CLI help updates clarifying command-specific --fields defaults.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@digizeph digizeph closed this pull request by merging all changes into main in 2cf8da3 Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

monocle search should specify the default value of --fields in --help

2 participants