diff --git a/Makefile.am b/Makefile.am index 067bddcb..4345a370 100644 --- a/Makefile.am +++ b/Makefile.am @@ -212,7 +212,7 @@ CHECKFLAGS_ALPHA = $(CHECKFLAGS_COMMON) --test-force-order-alpha CHECKFLAGS_PHYSICAL = $(CHECKFLAGS_COMMON) --test-force-order-physical -q -q -q # Verbose options -CHECKFLAGS_VERBOSE = $(CHECKFLAGS_ALPHA) -v -G +CHECKFLAGS_VERBOSE = $(CHECKFLAGS_ALPHA) -v --gui # Quiet options CHECKFLAGS = $(CHECKFLAGS_ALPHA) -q -q -q diff --git a/cmdline/list.c b/cmdline/list.c index 421c8c58..761aeaed 100644 --- a/cmdline/list.c +++ b/cmdline/list.c @@ -61,7 +61,8 @@ void state_list(struct snapraid_state* state) ++file_count; file_size += file->size; - log_tag("file:%s:%s:%" PRIu64 ":%" PRIi64 ":%u:%" PRIi64 "\n", disk->name, esc_tag(file->sub, esc_buffer), file->size, file->mtime_sec, file->mtime_nsec, file->inode); + if (state->opt.gui_verbose) + log_tag("file:%s:%s:%" PRIu64 ":%" PRIi64 ":%u:%" PRIi64 "\n", disk->name, esc_tag(file->sub, esc_buffer), file->size, file->mtime_sec, file->mtime_nsec, file->inode); t = file->mtime_sec; #if HAVE_LOCALTIME_R @@ -100,7 +101,8 @@ void state_list(struct snapraid_state* state) ++link_count; - log_tag("link_%s:%s:%s:%s\n", type, disk->name, esc_tag(slink->sub, esc_buffer), esc_tag(slink->linkto, esc_buffer_alt)); + if (state->opt.gui_verbose) + log_tag("link_%s:%s:%s:%s\n", type, disk->name, esc_tag(slink->sub, esc_buffer), esc_tag(slink->linkto, esc_buffer_alt)); printf("%12s ", type); printf(" "); diff --git a/cmdline/scan.c b/cmdline/scan.c index 9d03dac0..0452ca01 100644 --- a/cmdline/scan.c +++ b/cmdline/scan.c @@ -174,7 +174,7 @@ static void scan_link(struct snapraid_scan* scan, int is_diff, const char* sub, /* it's equal */ ++scan->count_equal; - if (state->opt.gui) { + if (state->opt.gui_verbose) { log_tag("scan:equal:%s:%s\n", disk->name, esc_tag(slink->sub, esc_buffer)); } } else { @@ -804,7 +804,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub, /* otherwise it's equal */ ++scan->count_equal; - if (state->opt.gui) { + if (state->opt.gui_verbose) { log_tag("scan:equal:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer)); } } @@ -969,7 +969,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub, /* meaning, and then we don't even save them */ ++scan->count_equal; - if (state->opt.gui) { + if (state->opt.gui_verbose) { log_tag("scan:equal:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer)); } } diff --git a/cmdline/snapraid.c b/cmdline/snapraid.c index 7c40e4a1..46666dcb 100644 --- a/cmdline/snapraid.c +++ b/cmdline/snapraid.c @@ -682,6 +682,8 @@ void config(char* conf, size_t conf_size, const char* argv0) #define OPT_TEST_SPEED_PERIOD 307 #define OPT_TEST_SPEED_DISKS_NUMBER 308 #define OPT_TEST_SPEED_BLOCKS_SIZE 309 +#define OPT_TEST_GUI 310 +#define OPT_TEST_GUI_VERBOSE 311 #if HAVE_GETOPT_LONG static struct option long_options[] = { @@ -717,9 +719,10 @@ static struct option long_options[] = { { "gen-conf", 1, 0, 'C' }, { "verbose", 0, 0, 'v' }, { "quiet", 0, 0, 'q' }, - { "gui", 0, 0, 'G' }, /* undocumented GUI interface option */ { "help", 0, 0, 'H' }, { "version", 0, 0, 'V' }, + { "gui", 0, 0, OPT_TEST_GUI }, /* undocumented GUI interface option (it was also 'G' in the past) */ + { "gui-verbose", 0, 0, OPT_TEST_GUI_VERBOSE }, /* undocumented GUI interface option */ /* The following are test specific options, DO NOT USE! */ @@ -866,8 +869,9 @@ static struct option long_options[] = { * Free letters: gIjJkKMnPQrtuxXWz * * The 's' letter is used in main.c + * The 'G' letter is free but only from 13.1 */ -#define OPTIONS "c:f:d:mebp:o:S:B:L:i:l:AZEUDNFRahTC:vqHVGw:" +#define OPTIONS "c:f:d:mebp:o:S:B:L:i:l:AZEUDNFRahTC:vqHVw:" volatile int global_interrupt = 0; @@ -1181,9 +1185,13 @@ int snapraid_main(int argc, char* argv[]) case 'q' : --msg_level; break; - case 'G' : + case OPT_TEST_GUI : opt.gui = 1; break; + case OPT_TEST_GUI_VERBOSE : + opt.gui = 1; + opt.gui_verbose = 1; + break; case 'H' : usage(conf); exit(EXIT_SUCCESS); diff --git a/cmdline/state.h b/cmdline/state.h index 1fcf1e74..5937f7b9 100644 --- a/cmdline/state.h +++ b/cmdline/state.h @@ -66,7 +66,8 @@ const char* lev_config_name(unsigned level); * For all these options a value of 0 means nothing set, and to use the default. */ struct snapraid_option { - int gui; /**< Gui output. */ + int gui; /**< GUI output. */ + int gui_verbose; /**< GUI verbose output. */ int auditonly; /**< In check, checks only the hash and not the parity. */ int badfileonly; /**< In fix, fixes only files marked as bad. */ int badblockonly; /**< In fix, fixes only the blocks marked as bad. */ diff --git a/cmdline/status.c b/cmdline/status.c index d9ca8cb0..01af483c 100644 --- a/cmdline/status.c +++ b/cmdline/status.c @@ -350,7 +350,7 @@ int state_status(struct snapraid_state* state) timemap[count++] = scrub_time; } - if (state->opt.gui) { + if (state->opt.gui_verbose) { if (info != 0) log_tag("block:%u:%" PRIu64 ":%s:%s:%s:%s\n", i, (uint64_t)info_get_time(info), one_valid ? "used" : "", one_invalid ? "unsynced" : "", info_get_bad(info) ? "bad" : "", info_get_rehash(info) ? "rehash" : ""); else