diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-12-02 13:40:27 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-12-02 13:40:27 +1030 |
commit | 4c6f5a73a0817641571fad7383ec3604487889f8 (patch) | |
tree | 996e01d64316740ec90f8e08270c89adc883188b | |
parent | 60824f8a0f758dc7808eb31cc83434ea78f44ed1 (diff) |
ccanlint: parse --verbose before anything else.
This way, we can debug really early failures (eg. during option
parsing).
-rw-r--r-- | tools/ccanlint/ccanlint.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/ccanlint/ccanlint.c b/tools/ccanlint/ccanlint.c index b35f11a7..d80c11d1 100644 --- a/tools/ccanlint/ccanlint.c +++ b/tools/ccanlint/ccanlint.c @@ -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)); |