Commit 4c6f5a73 authored by Rusty Russell's avatar Rusty Russell

ccanlint: parse --verbose before anything else.

This way, we can debug really early failures (eg. during option
parsing).
parent 60824f8a
......@@ -641,6 +641,8 @@ int main(int argc, char *argv[])
cmdline_exclude = btree_new(btree_strcmp);
info_exclude = btree_new(btree_strcmp);
opt_register_early_noarg("--verbose|-v", opt_inc_intval, &verbose,
"verbose mode (up to -vvvv)");
opt_register_noarg("-n|--safe-mode", opt_set_bool, &safe_mode,
"do not compile anything");
opt_register_noarg("-l|--list-tests", list_tests, NULL,
......@@ -652,8 +654,6 @@ int main(int argc, char *argv[])
" (can be used multiple times, or 'all')");
opt_register_noarg("--summary|-s", opt_set_bool, &summary,
"simply give one line summary");
opt_register_noarg("--verbose|-v", opt_inc_intval, &verbose,
"verbose mode (up to -vvvv)");
opt_register_arg("-x|--exclude <testname>", skip_test, NULL, NULL,
"exclude <testname> (can be used multiple times)");
opt_register_arg("-t|--timeout <milleseconds>", opt_set_uintval,
......@@ -671,6 +671,9 @@ int main(int argc, char *argv[])
" of CCAN modules.",
"This usage message");
/* Do verbose before anything else... */
opt_early_parse(argc, argv, opt_log_stderr_exit);
/* We move into temporary directory, so gcov dumps its files there. */
if (chdir(temp_dir(talloc_autofree_context())) != 0)
err(1, "Error changing to %s temporary dir", temp_dir(NULL));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment