nushell/crates/nu-command/src
Andrés N. Robalino 19d5f782cc
Allow dropping columns. (#3107)
`drop` is used for removing the last row. Passing a number allows dropping N rows.
Here we introduce the same logic for dropping columns instead.

You can certainly remove columns by using `reject`, however, there could be cases
where we are interested in removing columns from tables that contain, say, a big
number of columns. Using `reject` becomes impractical, especially when you don't
care about the column names that could either be known or not known when exploring
tables.

```
> echo [[lib, extension]; [nu-core, rs] [rake, rb]]
─────────┬───────────
   lib   │ extension
─────────┼───────────
 nu-core │ rs
 rake    │ rb
─────────┴───────────
```

```
> echo [[lib, extension]; [nu-core, rs] [rake, rb]] | drop column
─────────
   lib
─────────
 nu-core
 rake
─────────
```
2021-02-25 15:37:21 -05:00
..
commands Allow dropping columns. (#3107) 2021-02-25 15:37:21 -05:00
examples Minimal markdown syntax per element support. (#2997) 2021-02-02 12:09:19 -05:00
utils Fix latest clippy warnings (#3049) 2021-02-12 23:13:14 +13:00
commands.rs Allow dropping columns. (#3107) 2021-02-25 15:37:21 -05:00
examples.rs refactor parser: rename method pub fn block to parse_block (#3047) 2021-02-13 09:31:11 +13:00
futures.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
lib.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
maybe_print_errors.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
prelude.rs Fix latest clippy warnings (#3049) 2021-02-12 23:13:14 +13:00
script.rs Keep the environment properly set. (#3072) 2021-02-18 15:56:14 +13:00
utils.rs Ensure selection of columns are done once per column (#3012) 2021-02-05 19:34:26 -05:00