nushell/crates/nu-cli/tests/commands
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
..
hash_ Add hash command with base64 subcommand (#2769) 2020-12-01 06:47:35 +13:00
keep Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
math Tighten how input streams handle nothing, and related (#2847) 2021-01-03 14:22:44 +13:00
move_ Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
path Path Command Enhancement Project (#2742) 2020-11-24 22:18:38 +13:00
random Add random chars cmd (#2782) 2020-12-09 06:43:46 +13:00
skip Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
str_ Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
append.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
autoenv_trust.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
autoenv_untrust.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
autoenv.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
cal.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
cd.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
compact.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
count.rs Fix column count to not break on empty tables (#2374) 2020-08-18 22:16:35 -04:00
cp.rs When the nushell is located in a path that has a space in it, these tests break, this fixes it (#1944) 2020-06-07 15:50:52 +12:00
def.rs Add comments to next LiteCommand (#2846) 2021-01-08 06:14:51 +13:00
default.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
drop.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
each.rs Add in parameter inference for blocks (#2706) 2020-10-27 20:37:35 +13:00
echo.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
empty.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
enter.rs Improve some errors, streamline internal error handling (#2839) 2021-01-02 08:52:19 +13:00
every.rs Don't leak set/set-env/source scopes via actions (#2849) 2021-01-03 19:44:21 +13:00
first.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
flatten.rs Fix typos (#2842) 2021-01-02 17:24:32 +13:00
format.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
get.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
group_by.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
headers.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
histogram.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
insert.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
into_int.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
last.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
lines.rs Remove the line primitive (#2887) 2021-01-08 14:45:25 +13:00
ls.rs Inode added to ls -l (#2711) 2020-10-31 06:39:01 +13:00
merge.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
mkdir.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
mod.rs Obey precedence rules in which; Fix #2875 (#2885) 2021-01-09 06:44:31 +13:00
nth.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
open.rs Improve some errors, streamline internal error handling (#2839) 2021-01-02 08:52:19 +13:00
parse.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
prepend.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
range.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
reduce.rs Tighten how input streams handle nothing, and related (#2847) 2021-01-03 14:22:44 +13:00
rename.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
reverse.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
rm.rs remove without check path exist, rm -f (#2590) 2020-09-22 17:11:31 -04:00
save.rs Fix new clippy warnings (#2760) 2020-11-22 13:37:16 +13:00
select.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
semicolon.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
sort_by.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
split_by.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
split_column.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
split_row.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
touch.rs touch: support multiple arguments (#2386) 2020-08-22 12:08:30 +12:00
uniq.rs Fix new clippy warnings (#2760) 2020-11-22 13:37:16 +13:00
update.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
where_.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00
which.rs Obey precedence rules in which; Fix #2875 (#2885) 2021-01-09 06:44:31 +13:00
with_env.rs Convert table of primitives to positional arguments for external cmd (#2232) 2020-07-23 09:41:34 +12:00
wrap.rs Remove it expansion (#2701) 2020-10-26 19:55:52 +13:00