nushell/crates/nu-command/src
Darren Schroeder 0780300fb3
add a new inspect command for more debugging (#8028)
# Description

The purpose of this command is to help to debug pipelines. It works by
allowing you to inject the `inspect` command into a pipeline at any
point. Then it shows you what the input description is and what the
input values are that are passed into `inspect`. With each step it
prints this information out while also passing the value information on
to the next step in the pipeline.


![image](https://user-images.githubusercontent.com/343840/218154064-e107859b-d0da-41c6-8e34-2d717639b81c.png)

This command is kind of a "hack job" because it clones maybe too much
and I had to get creative in order to output two different tables. I'm
sure there are many ways this can be improved or combined into other
commands but I wanted to start here. Note that the `inspect` output is
written to stderr and the normal nushell output is written to stdout. If
we were to output both to stdout, nushell would get confused.

# User-Facing Changes



# 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

# 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.
2023-02-11 18:59:11 +00:00
..
bits Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
bytes Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
charting Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
conversions A fill command to replace str lpad and str rpad (#7846) 2023-02-09 14:56:52 -06:00
core_commands Make metadata a Category::Debug command (#8019) 2023-02-10 08:09:21 -06:00
database Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00
dataframe Make plugin commands support examples. (#7984) 2023-02-08 16:14:18 -06:00
date report which datetime couldn't be converted (#7980) 2023-02-06 14:17:07 -06:00
deprecated A fill command to replace str lpad and str rpad (#7846) 2023-02-09 14:56:52 -06:00
env Load env pwd (#7963) 2023-02-05 23:40:46 +01:00
experimental view span & view files commands (#7989) 2023-02-09 11:35:23 -06:00
filesystem Filesystem commands print --verbose to stderr (#8014) 2023-02-09 10:29:34 -08:00
filters Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
formats Added fix for #7981 - Replaced crate serde_ini with rust-ini for package nu-command/from (#8009) 2023-02-09 12:47:45 +01:00
generators Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
hash Make plugin commands support examples. (#7984) 2023-02-08 16:14:18 -06:00
math Update few examples of math commands (#7987) 2023-02-06 13:43:00 +01:00
misc Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
network http: add --insecure flag to http get, share common code (#7992) 2023-02-07 14:22:19 -08:00
path Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
platform Validate input range of du flags (#7962) 2023-02-06 21:34:32 +01:00
random Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
shells Add more input/output type annotations (#7532) 2022-12-21 20:20:46 +01:00
strings A fill command to replace str lpad and str rpad (#7846) 2023-02-09 14:56:52 -06:00
system add a new inspect command for more debugging (#8028) 2023-02-11 18:59:11 +00:00
viewers Address #7997 (#8000) 2023-02-07 20:01:31 -06:00
default_context.rs add a new inspect command for more debugging (#8028) 2023-02-11 18:59:11 +00:00
example_test.rs Remove deprecated --numbered flag from four commands (#7777) 2023-02-02 16:59:58 -06:00
input_handler.rs Standardise the use of ShellError::UnsupportedInput and ShellError::TypeMismatch and add spans to every instance of the former (#7217) 2022-12-23 01:48:53 -05:00
lib.rs Progress bar Implementation (#7661) 2023-01-10 20:57:48 -05:00
progress_bar.rs Reduce again the number of match calls (#7815) 2023-01-24 12:23:42 +01:00
sort_utils.rs Reduce again the number of match calls (#7815) 2023-01-24 12:23:42 +01:00