uutils / uutils/coreutils

uucore: Common abstraction for filename-or-stdin

Open
#8,952 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

U - All (uucore)
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.