argv-parser: Add assertion to find likely bugs in client code.
authorBen Pfaff <blp@gnu.org>
Sat, 30 May 2009 04:51:45 +0000 (21:51 -0700)
committerBen Pfaff <blp@gnu.org>
Sun, 7 Jun 2009 04:11:18 +0000 (21:11 -0700)
src/libpspp/argv-parser.c

index b3dc46134a81653a9698269a7da8b0ceec033058..ecf1ab23c74264ba4331ba413e5b14edd4836125 100644 (file)
@@ -78,6 +78,7 @@ argv_parser_add_options (struct argv_parser *ap,
         ap->options = x2nrealloc (ap->options, &ap->allocated_options,
                                   sizeof *ap->options);
 
+      assert (src->long_name != NULL || src->short_name != 0);
       dst = &ap->options[ap->n_options++];
       dst->base = *src;
       dst->cb = cb;