nushell/crates
Leonhard Kipp 5356cb9fbd
Obey precedence rules in which; Fix #2875 (#2885)
* Obay precedence rules in which; Fix #2875

Before which did not obay the precedence of alias before def commands.
Furthermore, `which -a echo` would only report either an alias or a def command or an
internal command with the provided name. Not all.

With this commit applied its fixed :)

Example:
```shell
/home/leo/repos/nushell(fix/which_reports_wrong_usage)> def echo [] {^echo hi}
/home/leo/repos/nushell(fix/which_reports_wrong_usage)> echo
hi
/home/leo/repos/nushell(fix/which_reports_wrong_usage)> which -a echo
───┬──────┬──────────────────────────┬─────────
 # │ arg  │           path           │ builtin
───┼──────┼──────────────────────────┼─────────
 0 │ echo │ Nushell custom command   │ No
 1 │ echo │ Nushell built-in command │ Yes
 2 │ echo │ /usr/bin/echo            │ No
───┴──────┴──────────────────────────┴─────────
/home/leo/repos/nushell(fix/which_reports_wrong_usage)> alias echo = ^echo hi there
/home/leo/repos/nushell(fix/which_reports_wrong_usage)> echo
hi there
/home/leo/repos/nushell(fix/which_reports_wrong_usage)> which -a echo
───┬──────┬──────────────────────────┬─────────
 # │ arg  │           path           │ builtin
───┼──────┼──────────────────────────┼─────────
 0 │ echo │ Nushell alias            │ No
 1 │ echo │ Nushell custom command   │ No
 2 │ echo │ Nushell built-in command │ Yes
 3 │ echo │ /usr/bin/echo            │ No
───┴──────┴──────────────────────────┴─────────
```

* Fix clippy lint

* Fix vec always Some even if empty
2021-01-09 06:44:31 +13:00
..
nu_plugin_binaryview Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_chart Update dependency rust-embed now that issue with its use of syn has been fixed. (#2880) 2021-01-07 14:33:39 +13:00
nu_plugin_fetch updated dependencies (#2857) 2021-01-07 13:38:22 +13:00
nu_plugin_from_bson Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_from_sqlite Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_inc Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_match Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_post Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00
nu_plugin_ps Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_s3 Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_selector Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_start Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_sys Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_textview updated dependencies (#2857) 2021-01-07 13:38:22 +13:00
nu_plugin_to_bson Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00
nu_plugin_to_sqlite Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00
nu_plugin_tree Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu_plugin_xpath Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu-cli Obey precedence rules in which; Fix #2875 (#2885) 2021-01-09 06:44:31 +13:00
nu-data Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00
nu-errors Document lexer (#2865) 2021-01-07 16:03:00 +13:00
nu-json updated dependencies (#2857) 2021-01-07 13:38:22 +13:00
nu-parser Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00
nu-plugin Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu-protocol Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00
nu-source Document lexer (#2865) 2021-01-07 16:03:00 +13:00
nu-stream Remove the line primitive (#2887) 2021-01-08 14:45:25 +13:00
nu-table Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu-test-support Bump to 0.25.1 for the hotfix release (#2870) 2021-01-06 15:16:08 +13:00
nu-value-ext Rename the Path and Pattern primitives (#2889) 2021-01-08 20:30:41 +13:00