summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-24 18:14:42 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-28 18:23:05 +0200
commiteb8bc57240d5d3e4680ff1df18a0a7792e96bd0c (patch)
treeb3dc566505456d6a121bc0e3f03883e52bd7ac7a /cmdutils.c
parent78046dadc3145a7afd16034ab1178033a053a03e (diff)
cmdutils: remove OPT_FUNC2
Make ff* tools only accept opt_* functions taking two arguments. The distinction between functions with one and two arguments is quite pointless. Simplify parse_options() code.
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 8c9542accb..2bc6b7417f 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -273,15 +273,13 @@ 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_FUNC2) {
- if (po->u.func2_arg(opt, arg) < 0) {
- fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
- exit(1);
- }
} else if (po->flags & OPT_DUMMY) {
/* Do nothing for this option */
} else {
- po->u.func_arg(arg);
+ if (po->u.func_arg(opt, arg) < 0) {
+ fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
+ exit(1);
+ }
}
if(po->flags & OPT_EXIT)
exit(0);