Skip to content

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

Closed

Description

@jmuecke

Some help attributes list the default value:

      --time-format <TIME_FORMAT>
          Timestamp output format (unix or rfc3339), applied to all output formats including JSON

          Possible values:
          - unix:    Unix timestamp (integer or float) - default for backward compatibility
          - rfc3339: RFC3339/ISO 8601 format (e.g., "2023-10-11T15:00:00Z")

          [default: unix]

Fields does not have one:

  -f, --fields <FIELDS>
          Comma-separated list of fields to output. Available fields: type, timestamp, peer_ip,
 peer_asn, prefix, path_id, as_path, origin_asns, origin, next_hop, local_pref, med, communitie
s, atomic, aggr_asn, aggr_ip, only-to-customer, collector

      --order-by <ORDER_BY>

But it has a default value: https://github.com/bgpkit/monocle/blob/main/src/bin/commands/elem_format.rs#L54

I assume this was introduced to avoid having different help texts for monocle parse and monocle search. However, presenting the used default value would make it more accessible to anyone not familiar with BGP dumps. For example, students in computer networking classes who encounter BGP for the first time.

Expected behavior

All options that have a default value should specify the default for the used command.

Activity

  1. digizeph commented on Nov 3, 2026

    @digizeph
    Member

    What do you think of #160?

  2. jmuecke commented on Nov 3, 2026

    @jmuecke
    ContributorAuthor

    Looks good. I have nits about it though :)

    It introduces a second format to list defaults instead of the already used [default: ....].
    I find that format much faster to skim. So I would maintain this format or at least have an empty line preceding the new default format.

    I would also like to have a comment on order. What do you think about: all fields except [...] in prior order?

  3. digizeph commented on Nov 3, 2026

    @digizeph
    Member

    happy to take a pr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions