docs(cli): update --stop-after doc examples to match duration-str grammar - #2868
Conversation
|
😎 Merged successfully - details. |
|
Automated review by Claude — this is a fully automated review; no human has vetted it. No issues found. The updated Generated by Claude Code |
There was a problem hiding this comment.
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)
763450c to
e5e2809
Compare
|
The latest commit addresses the earlier feedback: the bare-number example ( 🤖 Fully automated review by Claude Code — posted without human review; may contain mistakes, please verify. Generated by Claude Code |
|
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? |
|
@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. |
Summary
Update the
--stop-afterCLI help examples to match the duration formats accepted by theduration-strparser.Fixes #2867
Root Cause
The help text for the
--stop-afteroption inbinaries/cli/src/command/run.rsdid 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
--stop-afterdocumentation examples to use validduration-strformats.10s5m1h30m500msThis aligns the CLI help text with the formats accepted by
common::parse_duration.Testing
cargo fmt --all -- --checkcargo check -p dora-cliScope
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.