forked from extern/nushell
* Display aliases and custom commands in which; Fix #2810 Example output of nu after the commit is applied: ```shell /home/leo/repos/nushell(feature/which_inspect_alias)> def docker-ps [] { docker ps --format '{{json .}}' | from json -o } /home/leo/repos/nushell(feature/which_inspect_alias)> which docker-ps ───┬───────────┬────────────────────────┬───────── # │ arg │ path │ builtin ───┼───────────┼────────────────────────┼───────── 0 │ docker-ps │ nushell custom command │ No ───┴───────────┴────────────────────────┴───────── /home/leo/repos/nushell(feature/which_inspect_alias)> alias d = gid pd /home/leo/repos/nushell(feature/which_inspect_alias)> which d ───┬─────┬───────────────┬───────── # │ arg │ path │ builtin ───┼─────┼───────────────┼───────── 0 │ d │ nushell alias │ No ───┴─────┴───────────────┴───────── ``` * Update documentation
This commit is contained in:
@ -79,3 +79,27 @@ Passing the `all` flag identifies all instances of a command or binary
|
||||
builtin │ No
|
||||
─────────┴────────────────────────────────
|
||||
```
|
||||
|
||||
`which` also identifies aliases
|
||||
|
||||
```shell
|
||||
> alias e = echo
|
||||
> which e
|
||||
───┬─────┬───────────────┬─────────
|
||||
# │ arg │ path │ builtin
|
||||
───┼─────┼───────────────┼─────────
|
||||
0 │ e │ Nushell alias │ No
|
||||
───┴─────┴───────────────┴─────────
|
||||
```
|
||||
|
||||
and custom commands
|
||||
|
||||
```shell
|
||||
> def my_cool_echo [arg] { echo $arg }
|
||||
> which my_cool_echo
|
||||
───┬──────────────┬────────────────────────┬─────────
|
||||
# │ arg │ path │ builtin
|
||||
───┼──────────────┼────────────────────────┼─────────
|
||||
0 │ my_cool_echo │ Nushell custom command │ No
|
||||
───┴──────────────┴────────────────────────┴─────────
|
||||
```
|
||||
|
Reference in New Issue
Block a user