nushell/crates/nu-command/src/filesystem
Michael Albers c12b211075
Fix missing file names from rm errors (#9120)
# Description
Fixes a small bug with `rm` where names of files which couldn't be
deleted due to error were not printed.

Fixes https://github.com/nushell/nushell/issues/9004

# User-Facing Changes
Slightly different error message than previously. Nothing significant,
though.

The new error message looks like this
```
~/Projects/rust/nushell> rm /proc/1/mem                                                                                                                                                            05/06/2023 01:13:23 PM
Error: nu:🐚:remove_not_possible

  × Remove not possible
   ╭─[entry #3:1:1]
 1 │ rm /proc/1/mem
   ·    ─────┬─────
   ·         ╰── Could not delete /proc/1/mem: Operation not permitted (os error 1)
   ╰────

```

or when using a glob (only showing a single entry for brevity)

```
Error: nu:🐚:remove_not_possible

  × Remove not possible
   ╭─[entry #2:1:1]
 1 │ rm --recursive --force --verbose /proc/1/*
   ·                                  ────┬────
   ·                                      ╰── Could not delete /proc/1/comm: Operation not permitted (os error 1)
   ╰────
```

# Tests + Formatting
No new unit tests were added for this change as it is pretty difficult
to test this particular case. However, manual testing was run with the
following commands

```
rm /proc/1/mem
rm --recursive --force --verbose /proc/1/*
```

# After Submitting
N/A
2023-06-18 10:00:12 +02:00
..
cd_query.rs Fix typos by codespell (#7600) 2022-12-26 02:31:26 -05:00
cd.rs REFACTOR: remove the shell commands (#8415) 2023-05-13 12:40:11 -05:00
cp.rs add -u flag to cp, mv command (#9214) 2023-05-20 09:48:57 -07:00
glob.rs add the ability to have a list of glob excludes (#9343) 2023-06-02 12:37:17 -05:00
ls.rs chore: rename uid to user column in ls --long (#9407) 2023-06-11 18:02:08 +02:00
mkdir.rs Document and critically review ShellError variants - Ep. 2 (#8326) 2023-03-06 11:31:07 +01:00
mod.rs move BufferedReader out of nu-command (#7697) 2023-01-06 15:22:17 -08:00
mv.rs add -u flag to cp, mv command (#9214) 2023-05-20 09:48:57 -07:00
open.rs Add rest and glob support to 'open' (#8506) 2023-03-18 08:51:39 +13:00
rm.rs Fix missing file names from rm errors (#9120) 2023-06-18 10:00:12 +02:00
save.rs don't allow save command to save both stdout and stderr to the same file (#9368) 2023-06-10 10:09:19 +02:00
start.rs docs: Add missing space in Filesystem/start's usage (#8458) 2023-03-15 07:16:41 -05:00
touch.rs Document and critically review ShellError variants - Ep. 2 (#8326) 2023-03-06 11:31:07 +01:00
util.rs add -u flag to cp, mv command (#9214) 2023-05-20 09:48:57 -07:00
watch.rs Explain how to do time based bash watch (#9345) 2023-06-03 11:15:47 -05:00