cmdutils: remove unnecessary OPT_DUMMY implementation

The -i INPUT option can be implemented more cleanly by using a
function option, which can easily be done now that the
parse_arg_function passed to parse_options has a standard signature.
This commit is contained in:
Stefano Sabatini
2011-06-05 00:03:59 +02:00
parent 96f931adf7
commit b4af3cf347
3 changed files with 14 additions and 17 deletions

View File

@ -273,8 +273,6 @@ unknown_opt:
*po->u.int64_arg = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX);
} else if (po->flags & OPT_FLOAT) {
*po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
} else if (po->flags & OPT_DUMMY) {
/* Do nothing for this option */
} else {
if (po->u.func_arg(opt, arg) < 0) {
fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);