opt: allow parameter names in arguments.
[ccan] / ccan / opt / usage.c
index cbe1231a484fedf27e826a3485a1a333dd7314dd..25678d662d7feee7120b3c21559bf10461ea41de 100644 (file)
@@ -78,7 +78,9 @@ char *opt_usage(const char *argv0, const char *extra)
                        continue;
                }
                len = sprintf(p, "%s", opt_table[i].names);
-               if (opt_table[i].flags == OPT_HASARG)
+               if (opt_table[i].flags == OPT_HASARG
+                   && !strchr(opt_table[i].names, ' ')
+                   && !strchr(opt_table[i].names, '='))
                        len += sprintf(p + len, " <arg>");
                if (opt_table[i].desc || opt_table[i].show)
                        len += sprintf(p + len, "%.*s",