diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-03-08 22:41:31 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-03-08 22:41:31 +0000 |
commit | 860ac637bf56553a324f10491346c882a0dfeb1c (patch) | |
tree | 2a41db8b797d65d4486fa34c9ddbbda1bb15fd72 /comsat/comsat.c | |
parent | 955b5b09402ccd01b389ebf9951e8289745e6633 (diff) | |
download | mailutils-860ac637bf56553a324f10491346c882a0dfeb1c.tar.gz mailutils-860ac637bf56553a324f10491346c882a0dfeb1c.tar.bz2 |
Use mu_argp_parse.
Diffstat (limited to 'comsat/comsat.c')
-rw-r--r-- | comsat/comsat.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/comsat/comsat.c b/comsat/comsat.c index 97f194519..7bd68fd3d 100644 --- a/comsat/comsat.c +++ b/comsat/comsat.c @@ -53,6 +53,8 @@ static char doc[] = "GNU comsatd"; static struct argp_option options[] = { + {NULL, 0, NULL, 0, + "comsatd specific switches:", 0}, {"config", 'c', "FILE", 0, "Read configuration from FILE", 0}, { NULL, 0, NULL, 0, NULL, 0 } }; @@ -64,10 +66,17 @@ static struct argp argp = { comsatd_parse_opt, NULL, doc, - mu_daemon_argp_child, + NULL, NULL, NULL }; +static const char *comsat_argp_capa[] = { + "mailutils", + "daemon", + "logging", + NULL +}; + #define SUCCESS 0 #define NOT_HERE 1 #define PERMISSION_DENIED 2 @@ -106,7 +115,7 @@ comsatd_parse_opt (int key, char *arg, struct argp_state *state) switch (key) { case ARGP_KEY_INIT: - state->child_inputs[0] = state->input; + state->child_inputs[1] = state->input; break; case 'c': @@ -124,9 +133,9 @@ int main(int argc, char **argv) { int c; - - mu_create_argcv (argc, argv, &argc, &argv); - argp_parse (&argp, argc, argv, 0, 0, &daemon_param); + + mu_argp_parse (&argp, &argc, &argv, 0, comsat_argp_capa, + NULL, &daemon_param); if (daemon_param.timeout > 0 && daemon_param.mode == MODE_DAEMON) { |