* Add streaming support to save for ExternalStream data
Prior to this change, save would collect data from an ExternalStream (data
originating from externals) consuming memory for the full amount of data piped
to it,
This change adds streaming support for ExternalStream allowing saving of
arbitrarily large files and bounding memory usage.
* Remove broken save test
This test passes but not for the right reasons, since this test was
written filename has become a required parameter. The parser outputs
an error but the test still passes as is checking the original un-mutated
file assuming save has re-written the contents.
This change removes the test.
```
running 1 test
=== stderr
Error: nu::parser::missing_positional (https://docs.rs/nu-parser/0.60.0/nu-parser/enum.ParseError.html#variant.MissingPositional)
× Missing required positional argument.
╭─[source:1:1]
1 │ open save_test_1/cargo_sample.toml | save
· ▲
· ╰── missing filename
╰────
help: Usage: save {flags} <filename>
test commands::save::figures_out_intelligently_where_to_write_out_with_metadata ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 515 filtered out; finished in 0.10s
```
* have save --append create file if not exists
Currently, doing:
echo a | save --raw --append file.txt
will fail if file.txt does not exist. This PR changes that
* test that `save --append` will create new file
* move commands, futures.rs, script.rs, utils
* move over maybe_print_errors
* add nu_command crate references to nu_cli
* in commands.rs open up to pub mod from pub(crate)
* nu-cli, nu-command, and nu tests are now passing
* cargo fmt
* clean up nu-cli/src/prelude.rs
* code cleanup
* for some reason lex.rs was not formatted, may be causing my error
* remove mod completion from lib.rs which was not being used along with quickcheck macros
* add in allow unused imports
* comment out one failing external test; comment out one failing internal test
* revert commenting out failing tests; something else might be going on; someone with a windows machine should check and see what is going on with these failing windows tests
* Update Cargo.toml
Extend the optional features to nu-command
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>