-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
head,tail: implement undocumented option ---presume-input-pipe #2907
Comments
Possibly interesting context: https://lists.gnu.org/archive/html/coreutils/2020-08/msg00017.html, specifically:
I think it's okay to implement it as a noop for now, though. On the clap side of things, clap does not normally allow 3 leading dashes anymore since clap 3, but there is a workaround: to use alias instead. In static PRESUME_INPUT_TTY: &str = "-presume-input-tty";
// snip
App::new(uucore::util_name())
.version(crate_version!())
.about(ABOUT)
.arg(
Arg::new(PRESUME_INPUT_TTY)
.long(PRESUME_INPUT_TTY)
.alias(PRESUME_INPUT_TTY)
.hide(true)
) |
I looked into GNU coreutils. The parameter is used to bypass file seek operations. In uutils I see the below code differentiate between stdin (pipe) and file coreutils/src/uu/head/src/head.rs Line 424 in 6c1a655
I am thinking of doing Edit: I am not correct syntactically in the proposed solution, but I guess you get the idea. What I am trying to say is that the if the flag |
Is this still required? Can someone confirm if my approach is acceptable? I don't want to work on a PR that gets eventually rejected. |
@DevSabb I think what you're proposing is correct, at least that's what I would expect it to do based on your information and the mailing list I posted. |
GNU
head
andtail
have an undocumented option---presume-input-pipe
(notice the three dashes instead of two). I don't know what it does, but here is an example of it:Lack of support for this option is preventing some of the GNU test suite test cases to fail.
(See similar issue in split here #2864.)
The text was updated successfully, but these errors were encountered: