From 357cc1d23172220825902c5c55bd12044f031223 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 9 Mar 2015 11:56:04 +0100 Subject: btrfs-progs: convert, add option to disable progress MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With progress turned on by default we should be able to disable it as well. Reported-by: Jérôme Poulin Signed-off-by: David Sterba --- Documentation/btrfs-convert.txt | 2 ++ btrfs-convert.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/btrfs-convert.txt b/Documentation/btrfs-convert.txt index 17091970..6a9e1de0 100644 --- a/Documentation/btrfs-convert.txt +++ b/Documentation/btrfs-convert.txt @@ -31,6 +31,8 @@ set filesystem label during conversion. use label from the converted filesystem. -p:: Show progress of conversion, on by default. +--no-progress:: +Disable detailed progress and show only the main phases of conversion. EXIT STATUS ----------- diff --git a/btrfs-convert.c b/btrfs-convert.c index 730fead4..22fb0372 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -29,6 +29,7 @@ #include #include #include +#include #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; -- cgit v1.2.3