aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-fi-du.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-02-24 16:19:16 +0100
committerDavid Sterba <dsterba@suse.com>2016-03-14 13:42:47 +0100
commitaad4b1f0818b1ba2d861d1e4915184c8b4b7edf8 (patch)
tree6c2b03066b2c7b1bcc158d088fd16b772c0da361 /cmds-fi-du.c
parent54dea513c6c7deb6bac010ef5ad767bcbfa4f983 (diff)
downloadbtrfs-progs-aad4b1f0818b1ba2d861d1e4915184c8b4b7edf8.tar.gz
btrfs-progs-aad4b1f0818b1ba2d861d1e4915184c8b4b7edf8.tar.xz
btrfs-progs-aad4b1f0818b1ba2d861d1e4915184c8b4b7edf8.zip
btrfs-progs: fi du: add long options for units
Drop -h, add just the common long options for now. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-fi-du.c')
-rw-r--r--cmds-fi-du.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/cmds-fi-du.c b/cmds-fi-du.c
index 02e8144..236318b 100644
--- a/cmds-fi-du.c
+++ b/cmds-fi-du.c
@@ -279,15 +279,6 @@ static void clear_seen_inodes(void)
}
}
-const char * const cmd_filesystem_du_usage[] = {
- "btrfs filesystem du [options] <path> [<path>..]",
- "Summarize disk usage of each file.",
- "-h|--human-readable",
- " human friendly numbers, base 1024 (default)",
- "-s display only a total for each argument",
- NULL
-};
-
/*
* Inline extents are skipped because they do not take data space,
* delalloc and unknown are skipped because we do not know how much
@@ -533,28 +524,32 @@ out:
return ret;
}
+const char * const cmd_filesystem_du_usage[] = {
+ "btrfs filesystem du [options] <path> [<path>..]",
+ "Summarize disk usage of each file.",
+ HELPINFO_UNITS_LONG,
+ "-s display only a total for each argument",
+ NULL
+};
+
int cmd_filesystem_du(int argc, char **argv)
{
int ret = 0, error = 0;
int i;
+ unit_mode = get_unit_mode_from_arg(&argc, argv, 1);
+
optind = 1;
while (1) {
- int long_index;
static const struct option long_options[] = {
{ "summarize", no_argument, NULL, 's'},
- { "human-readable", no_argument, NULL, 'h'},
{ NULL, 0, NULL, 0 }
};
- int c = getopt_long(argc, argv, "sh", long_options,
- &long_index);
+ int c = getopt_long(argc, argv, "s", long_options, NULL);
if (c < 0)
break;
switch (c) {
- case 'h':
- unit_mode = UNITS_HUMAN;
- break;
case 's':
summarize = 1;
break;