From 5f7191135fe7467468205c329e5e801530a3bc7c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 11 Dec 2020 17:08:31 +0100 Subject: [PATCH] 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 --- Documentation/btrfs-scrub.asciidoc | 8 ++++---- cmds/filesystem-du.c | 2 +- cmds/scrub.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/btrfs-scrub.asciidoc b/Documentation/btrfs-scrub.asciidoc index 44a83ffb..c49e34af 100644 --- a/Documentation/btrfs-scrub.asciidoc +++ b/Documentation/btrfs-scrub.asciidoc @@ -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 diff --git a/cmds/filesystem-du.c b/cmds/filesystem-du.c index 8370140e..23efdf9d 100644 --- a/cmds/filesystem-du.c +++ b/cmds/filesystem-du.c @@ -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) { diff --git a/cmds/scrub.c b/cmds/scrub.c index e96dc998..fe2798dc 100644 --- a/cmds/scrub.c +++ b/cmds/scrub.c @@ -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) {