`seq`: propogate errors to `uumain`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
In reference to https://github.com/uutils/coreutils/pull/3112#discussion_r804508653 and the comment afterwards, it would be nice if we could propagate InvalidSpec errors from that PR through seq.rs's uu_main. Currently, we do the following in seq.rs in two places:
if let Err(x) = Memo::run_all(f, &[s]) {
show!(x);
exit(1);
}
Propagating this error as opposed to the above proves to be non-trivial, however, because of this ErrorKind check - if we generalize print_seq()/print_seq_integers() to return a UResult as opposed to an io::Result then we lose the ability to handle BrokenPipes gracefully.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/uu/seq/src/seq.rs, especially uu_main, the two Memo::run_all calls, print_seq(), print_seq_integers(), and the ErrorKind check around lines 141–145. Trace how InvalidSpec is currently shown and exited, then preserve graceful BrokenPipe handling while propagating the error through uu_main. Done means InvalidSpec reaches uu_main without losing BrokenPipe behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100