diff options
author | David Sterba <dsterba@suse.cz> | 2015-03-09 11:56:04 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-09 12:06:58 +0100 |
commit | 357cc1d23172220825902c5c55bd12044f031223 (patch) | |
tree | dbe361ce9971459d354e903f761b4b49e14cabb3 /btrfs-convert.c | |
parent | c8e3b06b80aa9512ed01340b3ce1eaf451a8475b (diff) | |
download | btrfs-progs-357cc1d23172220825902c5c55bd12044f031223.tar.gz |
btrfs-progs: convert, add option to disable progress
With progress turned on by default we should be able to disable it
as well.
Reported-by: Jérôme Poulin <jeromepoulin@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'btrfs-convert.c')
-rw-r--r-- | btrfs-convert.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c index 730fead..22fb037 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -29,6 +29,7 @@ #include <unistd.h> #include <uuid/uuid.h> #include <linux/limits.h> +#include <getopt.h> #include "ctree.h" #include "disk-io.h" @@ -2767,6 +2768,7 @@ static void print_usage(void) printf("\t-l LABEL set filesystem label\n"); printf("\t-L use label from converted fs\n"); printf("\t-p show converting progress (default)\n"); + printf("\t--no-progress show only overview, not the detailed progress\n"); } int main(int argc, char *argv[]) @@ -2783,7 +2785,15 @@ int main(int argc, char *argv[]) char *fslabel = NULL; while(1) { - int c = getopt(argc, argv, "dinrl:Lp"); + int long_index; + enum { GETOPT_VAL_NO_PROGRESS = 256 }; + static const struct option long_options[] = { + { "no-progress", no_argument, NULL, GETOPT_VAL_IEC}, + { NULL, 0, NULL, 0 } + }; + int c = getopt_long(argc, argv, "dinrl:Lp", long_options, + &long_index); + if (c < 0) break; switch(c) { @@ -2815,6 +2825,9 @@ int main(int argc, char *argv[]) case 'p': progress = 1; break; + case GETOPT_VAL_NO_PROGRESS: + progress = 0; + break; default: print_usage(); return 1; |