-F/--body-file for body input across issue/pr/release/milestone #140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Add
-F/--body-file <PATH>to every command that takes--body, resolved once in the sharededitor::read_body/resolve_bodyhelpers (src/cli/editor.rs:68-104) so it lands for all call sites:fj issue create/edit/comment,fj pr create/edit/comment,fj release create/edit,fj milestone create/edit.--body-file -as stdin (matchinggh, which accepts-F -).--bodyand--body-filemutually exclusive via clap.--body-file <path>is given but the path is missing, error instead of falling through to$EDITOR, preserving the "never block in CI" property.Source: rasterstate/fj#124.
Priority
p1. An agent that generates a multi-paragraph markdown body almost always writes it to a temp file, then references it;
-F notes.mdis the muscle-memory call and the gh-parity workhorse. The sharp edge is automation-specific: omitting--bodyto a command that defaults to launching$EDITORsilently hangs a non-interactive job, where-F pathis an unambiguous, non-interactive read. The--body - < filefallback works but is strictly less ergonomic and breaks parity for ported scripts.Reason
Every body-accepting command takes inline
--body,--body -(stdin), or$EDITOR, but none accept-F/--body-file. The pattern is uniform: eachbody: Option<String>is documented identically and the shared resolvers (src/cli/editor.rs:68,:104) only understandSome("-")-> stdin,Some(s)-> literal,None-> editor; there is no "read this path" arm. Adding it to the shared helper closes the gap everywhere at once.Acceptance
-F/--body-file <PATH>works on issue/pr create+edit+comment, release create+edit, and milestone create+edit.--body-file -reads stdin;--bodyand--body-fileare mutually exclusive (clap-enforced).--body-filepath errors and never falls through to$EDITOR.editor::read_body/resolve_body; no per-command duplication.cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings, andcargo test --allpass.Dependencies
None. Sibling to rasterstate/fj#126, which adds file/stdin input to the raw
fj apibody; this issue covers human prose bodies on resource commands, that one covers raw HTTP request bodies on the api escape hatch. Different resolvers, kept separate deliberately.Size
M
-F/--body-filefor body input on any issue/pr/release/milestone command (gh-parity scripting gap) #124