@@ -828,6 +828,8 @@ static const char * const cmd_balance_status_usage[] = {
"Show status of running or paused balance",
"",
"-v|--verbose be verbose",
+ HELPINFO_GLOBAL_OPTIONS_HEADER,
+ HELPINFO_INSERT_VERBOSE,
NULL
};
@@ -844,9 +846,12 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
const char *path;
DIR *dirstream = NULL;
int fd;
- int verbose = 0;
int ret;
+ /* init global verbose if unset */
+ if (bconf.verbose < 0)
+ bconf.verbose = 0;
+
optind = 0;
while (1) {
int opt;
@@ -861,7 +866,7 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
switch (opt) {
case 'v':
- verbose = 1;
+ bconf.verbose++;
break;
default:
usage_unknown_option(cmd, argv);
@@ -907,7 +912,7 @@ static int cmd_balance_status(const struct cmd_struct *cmd,
(unsigned long long)args.stat.considered,
100 * (1 - (float)args.stat.completed/args.stat.expected));
- if (verbose)
+ if (bconf.verbose)
dump_ioctl_balance_args(&args);
ret = 1;
Transpire global --verbose option down to the btrfs balance status sub-command. Suggested-by: David Sterba <dsterba@suse.com> Signed-off-by: Anand Jain <anand.jain@oracle.com> --- cmds/balance.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)