mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
remove --column
from length
command and remove record
processing (#10091)
# Description This PR removes `record` processing from the `length` command. It just doesn't make sense to try and get the length of a record. This PR also removes the `--column` parameter. If you want to list or count columns, you could use `$table | columns` or `$table | columns | length`. close #10074 ### Before  ### After Catches records two different ways now. with the `input_output_types` checker  and with additional logic in the command for cases like `echo`  # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking 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` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # 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. -->
This commit is contained in:
@ -264,7 +264,7 @@ fn update_will_insert() -> TestResult {
|
||||
#[test]
|
||||
fn length_for_columns() -> TestResult {
|
||||
run_test(
|
||||
r#"[[name,age,grade]; [bill,20,a] [a b c]] | length -c"#,
|
||||
r#"[[name,age,grade]; [bill,20,a] [a b c]] | columns | length"#,
|
||||
"3",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user