diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-28 03:53:00 +0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-05-28 17:40:19 +0400 |
commit | 26513856d657de3b3afacae7c13fd99a7fe79d05 (patch) | |
tree | 89f497b6b71cd57d94e91d721772e575141325df /cmdutils.c | |
parent | 009f829dde811af654af7110326aea3a72c05d5e (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.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmdutils.c b/cmdutils.c index 778f0fb3cf..31866b5563 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -277,13 +277,11 @@ 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) { + } 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); exit(1); } - } else if (po->u.func_arg) { - po->u.func_arg(arg); } if(po->flags & OPT_EXIT) exit(0); |