Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Unix pipes support out of the box #72

Open
RazrFalcon opened this issue Mar 27, 2018 · 1 comment
Open

Unix pipes support out of the box #72

RazrFalcon opened this issue Mar 27, 2018 · 1 comment
Milestone

Comments

@RazrFalcon
Copy link

It will be great if I could just set some flag and callback to get an ability to read from stdin and write to stdout.

@killercup killercup added this to the 0.4.0 milestone Jun 10, 2018
@archaelus
Copy link

archaelus commented Oct 11, 2018

A few times now I've written an option that I wanted to turn into a Box<Read> / Box<Write> depending on whether a filename or a "-" was passed on the command line. It'd be neat if StructOpt or something could detect that (I have no idea between quicli and structopt where that responsibility would lie).

#[derive(Debug, StructOpt)]
struct Cli {
    #[structopt(short="o")]
    output: Box<Write>,
}

And then have myprog, myprog -o - turn into a boxed Stdout writer, and myprog -o somefile turn into a boxed File writer. Similarly readers/reader-writers depending on what traits you ask for in the box.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants