btrfs-progs: fix short/long unit size options

The two variants of unit options are not suitable for all commands, the
short options could interfere with existing options or limit future
extensions.

In 'filesystem du' the short options are not documented neither in help
text, nor in documentation so fix the code

In 'scrub status' it's the same but the documentation needs to be fixed
as well.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2020-12-11 17:08:31 +01:00
parent 022168c32d
commit 5f7191135f
3 changed files with 6 additions and 6 deletions

View File

@ -111,13 +111,13 @@ print human friendly numbers, base 1024, this is the default
select the 1024 base for the following options, according to the IEC standard
--si::::
select the 1000 base for the following options, according to the SI standard
-k|--kbytes::::
--kbytes::::
show sizes in KiB, or kB with --si
-m|--mbytes::::
--mbytes::::
show sizes in MiB, or MB with --si
-g|--gbytes::::
--gbytes::::
show sizes in GiB, or GB with --si
-t|--tbytes::::
--tbytes::::
show sizes in TiB, or TB with --si
EXIT STATUS

View File

@ -566,7 +566,7 @@ static int cmd_filesystem_du(const struct cmd_struct *cmd,
int i;
u32 kernel_version;
unit_mode = get_unit_mode_from_arg(&argc, argv, 1);
unit_mode = get_unit_mode_from_arg(&argc, argv, 0);
optind = 0;
while (1) {

View File

@ -1745,7 +1745,7 @@ static int cmd_scrub_status(const struct cmd_struct *cmd, int argc, char **argv)
int err = 0;
DIR *dirstream = NULL;
unit_mode = get_unit_mode_from_arg(&argc, argv, 1);
unit_mode = get_unit_mode_from_arg(&argc, argv, 0);
optind = 0;
while ((c = getopt(argc, argv, "dR")) != -1) {