Add a new --test-no-warnings option

It disables annoying warnings that expert user don't
want to see.
This commit is contained in:
Andrea Mazzoleni 2015-11-24 18:49:20 +01:00
parent cffa2f0c10
commit a79052baa6
4 changed files with 26 additions and 14 deletions

View file

@ -245,6 +245,7 @@ void config(char* conf, size_t conf_size, const char* argv0)
#define OPT_TEST_FORCE_AUTOSAVE_AT 283
#define OPT_TEST_FAKE_DEVICE 284
#define OPT_TEST_EXPECT_NEED_SYNC 285
#define OPT_NO_WARNINGS 286
#if HAVE_GETOPT_LONG
struct option long_options[] = {
@ -360,6 +361,9 @@ struct option long_options[] = {
/* Fake device data */
{ "test-fake-device", 0, 0, OPT_TEST_FAKE_DEVICE },
/* Disable annoying warnings */
{ "test-no-warnings", 0, 0, OPT_NO_WARNINGS },
{ 0, 0, 0, 0 }
};
#endif
@ -726,6 +730,9 @@ int main(int argc, char* argv[])
case OPT_TEST_FAKE_DEVICE :
opt.fake_device = 1;
break;
case OPT_NO_WARNINGS :
opt.no_warnings = 1;
break;
default :
/* LCOV_EXCL_START */
log_fatal("Unknown option '%c'\n", (char)c);