Add a missing dash to the `--total` argument applied in the
`test_df_output` test case. Before this commit, the argument `-total`
was treated as a path argument. After this commit, `--total` is
treated as a command-line option that causes the total file usage to
be displayed.
Fix a bug in which the error message displayed when using
`CmdResult::no_stdout()` was incorrectly showing stderr when it should
have been showing stdout.
* hashsum: add --no-names option from official b3sum tool
The official b3sum tool has a --no-names option for only printing the
hashes, omitting the filenames. This is quite handy when used from
scripts because it spares the postprocessing with "cut" or "awk".
Since the installed b3sum symlink would also serve as a drop-in for the
official tool, the --no-names option is expected to exist for
compatibility.
Add a --no-names option not only for b3sum but for hashsum in general
(and maybe GNU coreutils will also feel inspired to add this option).
Closes https://github.com/uutils/coreutils/issues/3360
Change formula from: "Used/Size * 100" to "Used/(Used + Avail) * 100".
This formula also works if "Used" and "Avail" do not add up to "Size",
which is the case if there are reserved disk blocks.
When doing
ln b b~
ln -f --b=simple a b
First, we create a backup of b
Then, we force the override of a => b but we make sure that the backup is
done.
So, we had a bug in the ordering of the actions.
we were first removing b. Therefore, losing the capability to do a backup of this.
Change formula from: "Used/Size * 100" to "Used/(Used + Avail) * 100".
This formula also works if "Used" and "Avail" do not add up to "Size",
which is the case if there are reserved disk blocks.
Previously, individual file sizes were used to compute the number width, which
would cause misalignment when the total has a greater number of digits, and is
different from the behavior of GNU wc
```
$ ./target/debug/wc -w -l -m -c -L deny.toml GNUmakefile
95 422 3110 3110 85 deny.toml
349 865 6996 6996 196 GNUmakefile
444 1287 10106 10106 196 total
$ wc -w -l -m -c -L deny.toml GNUmakefile
95 422 3110 3110 85 deny.toml
349 865 6996 6996 196 GNUmakefile
444 1287 10106 10106 196 total
```
"df --output ." was treated as "df --output=." and hence "." was
interpreted as a column name. With this commit, "." is treated as
an argument on its own.
Fixes#3324
Print a usage error when duplicat column names are specified to the
`--output` command-line argument. For example,
$ df --output=source,source
df: option --output: field ‘source’ used more than once
Try 'df --help' for more information.
Implement the "File" column in the `df` output table. Before this
commit, a blank entry appeared in the "File" column for each
row. After this commit, a "-" entry appears when `df` is run with no
positional arguments and the filename appears when run with positional
arguments. For example:
$ touch a b c && df --output=target,file a b c
Mounted on File
/ a
/ b
/ c
Produce a usage error on an invalid signal argument. For example,
$ timeout --signal=invalid 1 sleep 0
timeout: 'invalid': invalid signal
Try 'timeout --help' for more information.