diff options
author | Guillem Jover <guillem@debian.org> | 2010-10-07 09:49:26 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2010-11-19 05:21:12 +0100 |
commit | c9b7af92e5de0cc9ea40fad53c0e5aa5c93690cd (patch) | |
tree | 625703c1cd19a7a3fc32e49582fce38ba5221bfa /src/main.c | |
parent | a67107c05153db3fde51301450439761e1916a80 (diff) | |
download | dpkg-c9b7af92e5de0cc9ea40fad53c0e5aa5c93690cd.tar.gz |
Move action and obsolete related functionality to the myopt module
Reduce repeated code, and localize it where it belongs.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/main.c b/src/main.c index bdf4029f0..bd330f0ef 100644 --- a/src/main.c +++ b/src/main.c @@ -172,7 +172,6 @@ const char printforhelp[]= N_( "\n" "Options marked [*] produce a lot of output - pipe it through `less' or `more' !"); -const struct cmdinfo *cipaction = NULL; int f_pending=0, f_recursive=0, f_alsoselect=1, f_skipsame=0, f_noact=0; int f_autodeconf=0, f_nodebsig=0; int f_triggers = 0; @@ -219,17 +218,6 @@ static const struct forceinfo { { NULL } }; -static void setaction(const struct cmdinfo *cip, const char *value) { - if (cipaction) - badusage(_("conflicting actions -%c (--%s) and -%c (--%s)"), - cip->oshort, cip->olong, cipaction->oshort, cipaction->olong); - cipaction= cip; -} - -static void setobsolete(const struct cmdinfo *cip, const char *value) { - warning(_("obsolete option '--%s'\n"), cip->olong); -} - static void setdebug(const struct cmdinfo *cpi, const char *value) { char *endp; @@ -464,10 +452,6 @@ static const struct cmdinfo cmdinfos[]= { * The action entries are made with the ACTION macro, as they all * have a very similar structure. */ -#define ACTION(longopt,shortopt,code,function) \ - { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, (voidfnp)function } -#define OBSOLETE(longopt,shortopt) \ - { longopt, shortopt, 0, NULL, NULL, setobsolete, 0, NULL, NULL } #define ACTIONBACKEND(longopt, shortopt, backend) \ { longopt, shortopt, 0, NULL, NULL, setaction, 0, (void *)backend, (voidfnp)execbackend } |