opt: print usage correctly for early args.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 9 May 2018 03:09:47 +0000 (12:39 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 9 May 2018 03:09:47 +0000 (12:39 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/opt/usage.c

index 353d59bc48542d8423ddc3c437ed36146488ec37..12f44a48752e0e0d4e0d722c74b7513561334733 100644 (file)
@@ -110,7 +110,7 @@ static char *add_desc(char *base, size_t *len, size_t *max,
 
        base = add_str(base, len, max, opt->names);
        off = strlen(opt->names);
-       if (opt->type == OPT_HASARG
+       if ((opt->type & OPT_HASARG)
            && !strchr(opt->names, ' ')
            && !strchr(opt->names, '=')) {
                base = add_str(base, len, max, " <arg>");