]> git.ozlabs.org Git - ccan/commit
opt: add opt_log_stderr_exit helper, and opt_usage NULL option.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 7 Oct 2010 23:41:11 +0000 (10:11 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 7 Oct 2010 23:41:11 +0000 (10:11 +1030)
commit0191b7a74144ea8193961235f45715e715d4d8eb
treecde724d9b5525e0dc06c5962af69a1d7d795b026
parent3e8aea05784959a63cdb609d248f8266b03b56a6
opt: add opt_log_stderr_exit helper, and opt_usage NULL option.

The former encapsulates a common "just exit on error" case, the latter
avoids having to repeat the extra usage string.

(We actually would have crashed before if someone passed NULL there, even
 though the documentation said you could).
ccan/opt/opt.c
ccan/opt/opt.h
ccan/opt/test/run-correct-reporting.c
ccan/opt/test/run-helpers.c
ccan/opt/test/run-iter.c
ccan/opt/test/run-no-options.c
ccan/opt/test/run-usage.c
ccan/opt/test/run.c
ccan/opt/usage.c