summaryrefslogtreecommitdiff
path: root/cmds-qgroup.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-01-21 18:47:24 +0100
committerDavid Sterba <dsterba@suse.cz>2015-01-21 18:56:28 +0100
commit58a39524619f38d193b8adc3d57888ec07b612aa (patch)
tree877a5e4487d232197b8cc8bfb043a97ab7ab1633 /cmds-qgroup.c
parenta5b66a81bf6007b3c3b3b108ffcb4cbd75287d57 (diff)
btrfs-progs: add --human-readable option where applicable
Add an alias to -h to 'filesystem usage', 'filesystem df' and 'device usage' commands, same as the traditional 'df'. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-qgroup.c')
-rw-r--r--cmds-qgroup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index 5ee7162b..456f06e2 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -217,6 +217,8 @@ static const char * const cmd_qgroup_show_usage[] = {
"-f list all qgroups which impact the given path"
"(exclude ancestral qgroups)",
"--raw raw numbers in bytes",
+ "--human-readable",
+ " human firendly numbers in given base, 1024 by default",
"--iec use 1024 as a base (KiB, MiB, GiB, TiB)",
"--si use 1000 as a base (kB, MB, GB, TB)",
"--kbytes show sizes in KiB, or kB with --si",
@@ -260,6 +262,8 @@ static int cmd_qgroup_show(int argc, char **argv)
{"tbytes", no_argument, NULL, GETOPT_VAL_TBYTES},
{"si", no_argument, NULL, GETOPT_VAL_SI},
{"iec", no_argument, NULL, GETOPT_VAL_IEC},
+ { "human-readable", no_argument, NULL,
+ GETOPT_VAL_HUMAN_READABLE},
{0, 0, 0, 0}
};
c = getopt_long(argc, argv, "pcreFf",
@@ -317,6 +321,9 @@ static int cmd_qgroup_show(int argc, char **argv)
case GETOPT_VAL_IEC:
units_set_mode(&unit_mode, UNITS_BINARY);
break;
+ case GETOPT_VAL_HUMAN_READABLE:
+ unit_mode = UNITS_HUMAN_BINARY;
+ break;
default:
usage(cmd_qgroup_show_usage);
}