Browse Source

Use new opt_usage_exit_fail().

opt_usage_and_exit() exits with status 0, and prints to stdout.
This exits status 1 and prints to stderr.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 10 years ago
parent
commit
a6d1c65683
  1. 2
      check-commit-sig.c
  2. 2
      leak-anchor-sigs.c
  3. 2
      open-anchor-scriptsigs.c
  4. 2
      open-channel.c
  5. 2
      open-commit-sig.c

2
check-commit-sig.c

@ -46,7 +46,7 @@ int main(int argc, char *argv[])
opt_parse(&argc, argv, opt_log_stderr_exit);
if (argc != 7)
opt_usage_and_exit(NULL);
opt_usage_exit_fail("Expected 6 arguments");
o1 = pkt_from_file(argv[1], PKT__PKT_OPEN)->open;
o2 = pkt_from_file(argv[2], PKT__PKT_OPEN)->open;

2
leak-anchor-sigs.c

@ -22,7 +22,7 @@ int main(int argc, char *argv[])
opt_parse(&argc, argv, opt_log_stderr_exit);
if (argc != 2)
opt_usage_and_exit(NULL);
opt_usage_exit_fail("Expected 1 argument");
s = pkt_from_file(argv[1], PKT__PKT_OPEN_ANCHOR_SCRIPTSIGS)
->open_anchor_scriptsigs;

2
open-anchor-scriptsigs.c

@ -61,7 +61,7 @@ int main(int argc, char *argv[])
opt_parse(&argc, argv, opt_log_stderr_exit);
if (argc < 3)
opt_usage_and_exit(NULL);
opt_usage_exit_fail("Expected 2 or more arguments");
o1 = pkt_from_file(argv[1], PKT__PKT_OPEN)->open;
o2 = pkt_from_file(argv[2], PKT__PKT_OPEN)->open;

2
open-channel.c

@ -129,7 +129,7 @@ int main(int argc, char *argv[])
opt_parse(&argc, argv, opt_log_stderr_exit);
if (argc < 7)
opt_usage_and_exit(NULL);
opt_usage_exit_fail("Expected 6 or more arguments");
if (!hex_decode(argv[1], strlen(argv[1]), &seed, sizeof(seed)))
errx(1, "Invalid seed '%s' - need 256 hex bits", argv[1]);

2
open-commit-sig.c

@ -44,7 +44,7 @@ int main(int argc, char *argv[])
opt_parse(&argc, argv, opt_log_stderr_exit);
if (argc != 6)
opt_usage_and_exit(NULL);
opt_usage_exit_fail("Expected 5 arguments");
o1 = pkt_from_file(argv[1], PKT__PKT_OPEN)->open;
o2 = pkt_from_file(argv[2], PKT__PKT_OPEN)->open;

Loading…
Cancel
Save