Antoine Stevan
a1f989caf9
change the output of which
to be more explicit (#9646)
related to
- https://github.com/nushell/nushell/issues/9637#issuecomment-1629387548
# Description
this PR changes the output of `which` from `table<arg: string, path:
string, built-in: bool> (stream)` to `table<command: string, path:
string, type: string> (stream)`.
- `command`: same as `arg` but more explicit name
- `path`: same as before, `null` when built-in
- `type`: instead of `buil-in: bool` says if it's a `built-in` a
`custom` command, an `alias` or an `external`
# User-Facing Changes
the output of `which` has changed
## some examples
```nushell
> which open
╭───┬─────────┬──────┬──────────╮
│ # │ command │ path │ type │
├───┼─────────┼──────┼──────────┤
│ 0 │ open │ │ built-in │
╰───┴─────────┴──────┴──────────╯
```
```nushell
> alias foo = print "foo"
> which foo
╭───┬─────────┬──────┬───────╮
│ # │ command │ path │ type │
├───┼─────────┼──────┼───────┤
│ 0 │ foo │ │ alias │
╰───┴─────────┴──────┴───────╯
```
```nushell
> def bar [] {}
> which bar
╭───┬─────────┬──────┬────────╮
│ # │ command │ path │ type │
├───┼─────────┼──────┼────────┤
│ 0 │ bar │ │ custom │
╰───┴─────────┴──────┴────────╯
```
```nushell
> which git
╭───┬─────────┬──────────────┬──────────╮
│ # │ command │ path │ type │
├───┼─────────┼──────────────┼──────────┤
│ 0 │ git │ /usr/bin/git │ external │
╰───┴─────────┴──────────────┴──────────╯
```
```nushell
> which open git foo bar
╭───┬─────────┬──────────────┬──────────╮
│ # │ command │ path │ type │
├───┼─────────┼──────────────┼──────────┤
│ 0 │ open │ │ built-in │
│ 1 │ git │ /usr/bin/git │ external │
│ 2 │ foo │ │ alias │
│ 3 │ bar │ │ custom │
╰───┴─────────┴──────────────┴──────────╯
```
# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- ⚫ `toolkit test`
- ⚫ `toolkit test stdlib`
# After Submitting
mention that in the release note
2023-07-20 19:10:53 -05:00
..
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-12 18:12:59 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2022-11-22 16:58:11 -08:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-06-21 09:33:01 +12:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-07-12 18:12:59 +02:00
2023-07-15 09:51:28 +12:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-07-14 15:20:35 +12:00
2023-07-06 08:31:31 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2022-12-22 00:33:26 +02:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-06-10 16:57:26 -05:00
2023-07-05 12:30:53 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-03-15 18:54:55 +13:00
2023-07-17 18:43:51 +02:00
2023-03-15 18:54:55 +13:00
2023-05-17 18:34:44 -05:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-05-22 13:54:04 -05:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-05-17 18:55:26 -05:00
2023-07-14 15:20:35 +12:00
2023-07-17 18:43:51 +02:00
2023-07-13 09:12:20 -07:00
2022-12-10 19:24:06 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-14 15:20:35 +12:00
2023-07-06 08:31:31 -07:00
2023-07-17 18:43:51 +02:00
2023-07-01 07:57:51 +12:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-03-15 18:54:55 +13:00
2023-07-17 18:43:51 +02:00
2022-02-09 05:58:54 -05:00
2023-07-20 13:56:46 +02:00
2023-07-17 18:43:51 +02:00
2023-04-28 13:25:44 +02:00
2023-07-14 15:20:35 +12:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-20 20:16:03 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-01 07:57:51 +12:00
2023-03-28 12:40:29 -07:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-07-14 15:20:35 +12:00
2023-04-28 13:25:44 +02:00
2023-07-01 07:57:51 +12:00
2023-03-15 18:54:55 +13:00
2023-04-07 06:46:11 -05:00
2023-04-07 06:46:11 -05:00
2023-07-18 11:22:00 -05:00
2022-12-22 16:38:07 -08:00
2023-04-05 20:22:56 +03:00
2023-04-28 13:25:44 +02:00
2023-07-17 18:43:51 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-05-31 06:27:55 -05:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-07-20 19:10:53 -05:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-03-15 18:54:55 +13:00
2023-07-17 18:43:51 +02:00