This PR addresses an issue where `target_dirs` were being optimized out\
before being passed to the `get_filesystem_devices()` function.
The changes in this PR ensure that `target_dirs` are passed directly
to `get_filesystem_devices()`, and only then are they simplified.
Example of a command that currently doesn't work correctly:
```sh
dust -x $(findmnt -S tmpfs -o target -n)
```
It should show the usage of all tmpfs mounts, but it currently shows
just the the root mountpoints like `/run`, since all the mountpoints
nested under it are optimized out.
Because I'm not familiar with Rust, when I was working on
https://github.com/bootandy/dust/pull/390 I didn't realize that the
completions were auto-generated via clap. I'm sorry. This redoes it
with clap.
This improves not only the completions but also the --help and the
man page. Also the --output-format flag will raise an error if the
given value is invalid.
Currently options following regular arguments are not interpreted as
options. This fixes that.
Users can still treat values starting with a hyphen (`-`) as regular
arguments by using `--`, e.g.:
dust -d 2 -r ~/Documents -F -- --this-is-my-dir
add new option: --output-format this controls how the output is
summarised and takes:
nothing = default behaviour
si = SI units (same as old --si flag)
b = bytes
kb = kb
kib = si kb
mb = mb
mib = si mb
....etc
my 'many' line is: 4.0K ┌─┴ many │ the characters 4.0K are 4 chars.
photosheep's space for 'many' is '44B' which is 3 chars and so my system
needs 1 more char. Hence there is one more space character padding
floating round.
Provide "No such file or directory" error if file is not found.
Provide "Unknown Error" if other error found
Should reduce confusion from the generic other error
If a user reports a crash from stacksize - we can try different stack
memory sizes to try and figure out the cause.
Do not try and initialise rayon on 32 bit builds
Fix rayon initialisation, may not have been called before due to badly
formed closure