Start support for commandline args to nu itself (#851)

* cmdline args wip

* WIP

* redirect working

* Add help and examples

* Only show flags in signature of more than help
This commit is contained in:
JT
2022-01-26 09:42:39 -05:00
committed by GitHub
parent 285f65ba34
commit 8ee619954d
9 changed files with 307 additions and 97 deletions

View File

@ -14,7 +14,7 @@ pub use cp::Cp;
pub use ls::Ls;
pub use mkdir::Mkdir;
pub use mv::Mv;
pub use open::Open;
pub use open::{BufferedReader, Open};
pub use rm::Rm;
pub use save::Save;
pub use touch::Touch;

View File

@ -184,6 +184,12 @@ pub struct BufferedReader<R: Read> {
input: BufReader<R>,
}
impl<R: Read> BufferedReader<R> {
pub fn new(input: BufReader<R>) -> Self {
Self { input }
}
}
impl<R: Read> Iterator for BufferedReader<R> {
type Item = Result<Vec<u8>, ShellError>;