Skip to content

docs(cli): update --stop-after doc examples to match duration-str grammar - #2868

Merged
trunk-io[bot] merged 2 commits into
dora-rs:mainfrom
SaitejaKommi:docs/stop-after-duration-example
Aug 11, 2026
Merged

docs(cli): update --stop-after doc examples to match duration-str grammar#2868
trunk-io[bot] merged 2 commits into
dora-rs:mainfrom
SaitejaKommi:docs/stop-after-duration-example

Conversation

@SaitejaKommi

Copy link
Copy Markdown
Contributor

Summary

Update the --stop-after CLI help examples to match the duration formats accepted by the duration-str parser.

Fixes #2867

Root Cause

The help text for the --stop-after option in binaries/cli/src/command/run.rs did not fully reflect the duration formats supported by the parser. In particular, examples for compound durations (e.g. 1h30m) and sub-second durations (e.g. 500ms) were missing, making the CLI documentation less representative of the accepted syntax.

Solution

  • Updated the --stop-after documentation examples to use valid duration-str formats.
  • Added examples covering:
    • 10s
    • 5m
    • 1h30m
    • 500ms

This aligns the CLI help text with the formats accepted by common::parse_duration.

Testing

  • cargo fmt --all -- --check
  • cargo check -p dora-cli

Scope

This PR is intentionally limited to documentation updates in binaries/cli/src/command/run.rs. No parser behavior, runtime logic, or public APIs were modified.

@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

😎 Merged successfully - details.

Copy link
Copy Markdown
Collaborator

Automated review by Claude — this is a fully automated review; no human has vetted it.

No issues found. The updated --stop-after examples (10s, 5m, 1h30m, 500ms) all parse correctly through common::parse_duration (duration_str::parse) — the crate's own tests in binaries/cli/src/common.rs already cover exactly these forms. Docs-only change with no behavior impact.


Generated by Claude Code

@phil-opp phil-opp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The 1h30m and 500ms additions are good — those forms were genuinely undocumented.

But dropping --stop-after 30 # 30 seconds removes a form that works, and one that's explicitly pinned by a test. binaries/cli/src/common.rs:397:

// Bare numbers are seconds.
assert_eq!(parse_duration("15"), Ok(Duration::from_secs(15)));

duration_str::parse accepts a bare integer as seconds, so that line was accurate documentation of real behavior — and it's the one form a user can't infer from the others.

#2867 says the examples "may not match the duration format accepted by the parser". The gap was under-coverage, not inaccuracy: nothing currently documented is wrong. Removing a correct example to close it makes the help text less representative rather than more.

Could you restore the bare-number line and keep the additions?

    /// Examples:
    ///   --stop-after 30      # 30 seconds (a bare number is seconds)
    ///   --stop-after 10s     # 10 seconds
    ///   --stop-after 5m      # 5 minutes
    ///   --stop-after 1h30m   # 1 hour 30 minutes
    ///   --stop-after 500ms   # 500 milliseconds

Dropping the now-redundant 30s line is fine.

(generated with Claude)

@SaitejaKommi
SaitejaKommi force-pushed the docs/stop-after-duration-example branch from 763450c to e5e2809 Compare July 29, 2026 02:23
@SaitejaKommi
SaitejaKommi requested a review from phil-opp July 29, 2026 02:45

Copy link
Copy Markdown
Collaborator

The latest commit addresses the earlier feedback: the bare-number example (--stop-after 30 # 30 seconds) is restored, the 1h30m and 500ms additions are kept, and the redundant 30s line is dropped. All five forms parse through common::parse_duration and are pinned by parse_duration_accepts_common_forms in binaries/cli/src/common.rs. No further issues.


🤖 Fully automated review by Claude Code — posted without human review; may contain mistakes, please verify.


Generated by Claude Code

@SaitejaKommi

Copy link
Copy Markdown
Contributor Author

Hi @phil-opp , I've updated the examples to include the bare-number format along with the new examples and removed the redundant line as suggested. could you please take another look and approve when you get a chance?

@phil-opp phil-opp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

@SaitejaKommi the Trunk merge queue failed for this PR.

See the Trunk merge-status comment for details.

Posted as a new comment so GitHub sends an email — Trunk's sticky comment is edited in place and won't trigger a notification.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update --stop-after examples to match accepted duration format

2 participants