[RFC,08/14] btrfs-progs: migrate rescue super-recover to global verbose
diff mbox series

Message ID 1571652082-25982-9-git-send-email-anand.jain@oracle.com
State New
Headers show
Series
  • btrfs-progs: global-verbose option
Related show

Commit Message

Anand Jain Oct. 21, 2019, 10:01 a.m. UTC
Now with this patch 'btrfs rescue super-recover' can show verbose output
either by the top level --verbose option or by the sub-command -v
option.

Suggested-by: David Sterba <dsterba@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds/rescue.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Patch
diff mbox series

diff --git a/cmds/rescue.c b/cmds/rescue.c
index 1785bc164264..bd11241478a8 100644
--- a/cmds/rescue.c
+++ b/cmds/rescue.c
@@ -101,8 +101,8 @@  static const char * const cmd_rescue_super_recover_usage[] = {
 	"btrfs rescue super-recover [options] <device>",
 	"Recover bad superblocks from good copies",
 	"",
-	"-y	Assume an answer of `yes' to all questions",
-	"-v	Verbose mode",
+	"-y                 Assume an answer of `yes' to all questions",
+	HELPINFO_INSERT_VERBOSE_SHORT,
 	NULL
 };
 
@@ -118,7 +118,6 @@  static int cmd_rescue_super_recover(const struct cmd_struct *cmd,
 				    int argc, char **argv)
 {
 	int ret;
-	int verbose = 0;
 	int yes = 0;
 	char *dname;
 
@@ -129,7 +128,7 @@  static int cmd_rescue_super_recover(const struct cmd_struct *cmd,
 			break;
 		switch (c) {
 		case 'v':
-			verbose = 1;
+			global_verbose = true;
 			break;
 		case 'y':
 			yes = 1;
@@ -151,7 +150,7 @@  static int cmd_rescue_super_recover(const struct cmd_struct *cmd,
 		error("the device is busy");
 		return 1;
 	}
-	ret = btrfs_recover_superblocks(dname, verbose, yes);
+	ret = btrfs_recover_superblocks(dname, global_verbose, yes);
 	return ret;
 }
 static DEFINE_SIMPLE_COMMAND(rescue_super_recover, "super-recover");