nushell/crates/nu-command/src
Reilly Wood 57ce6a7c66
Fix ls behaviour when directory is empty (#8439)
Prior to this PR, `ls` would return `nothing` in an empty directory.
After this PR, it returns an empty `List`. This makes the behaviour of
`ls` more consistent and easier to reason about (IMO).

This was prompted by a user noticing that `ls | where size == 0KB and
type == file` breaks when run in an empty directory:

```
  × Input type not supported.
   ╭─[entry #12:1:1]
 1 │ ls | where size == 0KB and type == file
   · ─┬   ──┬──
   ·  │     ╰── only list, binary, raw data or range input data is supported
   ·  ╰── input type: nothing
   ╰────
```

If people agree with this change, let's wait until after the 0.77
release so we have a bit more time to test it.
2023-03-15 18:31:07 +13:00
..
bits Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
bytes Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
charting Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
conversions Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
database Fix SQLite table creation sql (#8430) 2023-03-13 10:11:28 -07:00
dataframe Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
date Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
debug Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
deprecated Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
env Error out when config.nu has no editor configured (#8282) 2023-03-09 08:07:20 -06:00
experimental Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
filesystem Fix ls behaviour when directory is empty (#8439) 2023-03-15 18:31:07 +13:00
filters Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
formats Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
generators Document and critically review ShellError variants - Ep. 2 (#8326) 2023-03-06 11:31:07 +01:00
hash Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
math Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
misc Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
network Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
path Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
platform Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
random Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00
shells Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00
strings Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
system Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
viewers Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
default_context.rs Remove the 'env' command, as we have the variable (#8185) 2023-03-01 21:20:00 +13:00
example_test.rs cratification: Example support (#8231) 2023-02-27 13:58:56 -08:00
input_handler.rs Box ShellError in Value::Error (#8375) 2023-03-12 09:57:27 +01:00
lib.rs Cratification: Break out nu_cmd_lang into a separate crate (#8181) 2023-02-24 09:54:42 -06:00
progress_bar.rs cp progress bar implementation (#8012) 2023-02-22 11:57:38 -08:00
sort_utils.rs Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00