nushell/crates
Xoffio 82ac590412
Progress bar Implementation (#7661)
# Description

_(Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.)_

I implemented the status bar we talk about yesterday. The idea was
inspired by the progress bar of `wget`.
I decided to go for the second suggestion by `@Reilly`
> 2. add an Option<usize> or whatever to RawStream (and ListStream?) for
situations where you do know the length ahead of time

For now only works with the command `save` but after the approve of this
PR we can see how we can implement it on commands like `cp` and `mv`

When using `fetch` nushell will check if there is any `content-length`
attribute in the request header. If so, then `fetch` will send it
through the new `Option` variable in the `RawStream` to the `save`.
If we know the total size we show the progress bar 

![nu_pb01](https://user-images.githubusercontent.com/38369407/210298647-07ee55ea-e751-41b1-a84d-f72ec1f6e9e5.jpg)
but if we don't then we just show the stats like: data already saved,
bytes per second, and time lapse.

![nu_pb02](https://user-images.githubusercontent.com/38369407/210298698-1ef65f51-40cc-4481-83de-309cbd1049cb.jpg)

![nu_pb03](https://user-images.githubusercontent.com/38369407/210298701-eef2ef13-9206-4a98-8202-e4fe5531d79d.jpg)

Please let me know If I need to make any changes and I will be happy to
do it.

# User-Facing Changes

A new flag (`--progress` `-p`) was added to the `save` command 
Examples:
```nu
fetch https://github.com/torvalds/linux/archive/refs/heads/master.zip | save --progress -f main.zip
fetch https://releases.ubuntu.com/22.04.1/ubuntu-22.04.1-desktop-amd64.iso | save --progress -f main.zip
open main.zip --raw | save --progress main.copy
```

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
-
I am getting some errors and its weird because the errors are showing up
in files i haven't touch. Is this normal?

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.

Co-authored-by: Reilly Wood <reilly.wood@icloud.com>
2023-01-10 20:57:48 -05:00
..
nu_plugin_custom_values Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu_plugin_example Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu_plugin_gstat Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu_plugin_inc Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu_plugin_python Fix typos by codespell (#7600) 2022-12-26 02:31:26 -05:00
nu_plugin_query Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-cli Remove engine_state clones in REPL eval (#7713) 2023-01-10 17:22:32 -08:00
nu-color-config Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-command Progress bar Implementation (#7661) 2023-01-10 20:57:48 -05:00
nu-engine Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-explore Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-glob Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-json Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-parser Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-path Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-plugin Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-pretty-hex Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-protocol Progress bar Implementation (#7661) 2023-01-10 20:57:48 -05:00
nu-system Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-table Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-term-grid Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-test-support Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
nu-utils Bump version to 0.74.0 (#7718) 2023-01-10 20:58:13 +01:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.