uucore: Common abstraction for filename-or-stdin
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
A common pattern in Unix tools is that an input filename argument is optional; when missing input should be read from stdin. Also often - as a filename means stdin should be used.
Currently every tool seems to handle this in an ad-hoc manner. It would be nice to have a common abstraction for this.
As a bonus, a smart implementation in the stdin case could just dup(STDIN_FILENO) , or open("/dev/stdin"), or just special case so that file descriptor for stdin isn't close()d - no dynamic dispatch needed.
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 by surveying how the Unix tools currently handle optional filenames, stdin, and the - filename convention. Define the common abstraction and its ownership behavior, then verify that adopting it removes the ad-hoc handling consistently across affected tools.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100