diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-11-19 20:19:26 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-11-19 20:19:26 +0000 |
commit | 72a077186e92a450090bf435f6e90a23f4375b43 (patch) | |
tree | 91f0ae951f4c8298b693cdf1cb9f32c999fd214a | |
parent | 9a972686a656dcbe2eabb7e176f9649c128fb373 (diff) | |
download | mailutils-72a077186e92a450090bf435f6e90a23f4375b43.tar.gz mailutils-72a077186e92a450090bf435f6e90a23f4375b43.tar.bz2 |
* include/mailutils/libargp.h (mu_argp_build): Change proto.
* libargp/compat.c (mu_argp_parse): Update call to mu_argp_build.
* libargp/mu_argp.c (mu_argp_build): Optionally return expanded
capability list in the third argument.
* libargp/muinit.c (mu_app_init): Pass expanded capability list to
mu_libcfg_init.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | include/mailutils/libargp.h | 2 | ||||
-rw-r--r-- | libargp/compat.c | 2 | ||||
-rw-r--r-- | libargp/mu_argp.c | 7 | ||||
-rw-r--r-- | libargp/muinit.c | 10 |
5 files changed, 20 insertions, 8 deletions
@@ -1,5 +1,12 @@ 2007-11-19 Sergey Poznyakoff <gray@gnu.org.ua> + * include/mailutils/libargp.h (mu_argp_build): Change proto. + * libargp/compat.c (mu_argp_parse): Update call to mu_argp_build. + * libargp/mu_argp.c (mu_argp_build): Optionally return expanded + capability list in the third argument. + * libargp/muinit.c (mu_app_init): Pass expanded capability list to + mu_libcfg_init. + * include/mailutils/cfg.h (mu_cfg_parser_verbose): New variable. * include/mailutils/libargp.h (OPT_RCFILE_VERBOSE): New value. * libargp/Makefile.am (AM_CFLAGS): Rename to AM_CPPFLAGS, define diff --git a/include/mailutils/libargp.h b/include/mailutils/libargp.h index ea15f7c20..c409f66cf 100644 --- a/include/mailutils/libargp.h +++ b/include/mailutils/libargp.h @@ -106,7 +106,7 @@ extern struct mu_cmdline_capa mu_auth_cmdline; extern void mu_libargp_init (void); -extern struct argp *mu_argp_build (const struct argp *argp); +extern struct argp *mu_argp_build (const struct argp *argp, char ***pcapa); extern void mu_argp_done (struct argp *argp); extern int mu_register_argp_capa (const char *name, struct argp_child *child); diff --git a/libargp/compat.c b/libargp/compat.c index dc328958a..a3dd2da0d 100644 --- a/libargp/compat.c +++ b/libargp/compat.c @@ -326,7 +326,7 @@ mu_argp_parse (const struct argp *myargp, if (!myargp) myargp = &argpnull; - argp = mu_argp_build (myargp); + argp = mu_argp_build (myargp, NULL); rc = argp_parse (argp, *pargc, *pargv, flags, arg_index, input); mu_argp_done (argp); if (rc) diff --git a/libargp/mu_argp.c b/libargp/mu_argp.c index 94f223d0d..4bce68a49 100644 --- a/libargp/mu_argp.c +++ b/libargp/mu_argp.c @@ -196,7 +196,7 @@ argp_reg_action (void *item, void *data) } struct argp * -mu_argp_build (const struct argp *init_argp) +mu_argp_build (const struct argp *init_argp, char ***pcapa) { struct cap_buf cb; struct argp *argp; @@ -206,7 +206,10 @@ mu_argp_build (const struct argp *init_argp) cap_buf_add (&cb, NULL); mu_libargp_init (); argp = mu_build_argp (init_argp, cb.capa); - cap_buf_free (&cb); + if (pcapa) + *pcapa = cb.capa; + else + cap_buf_free (&cb); return argp; } diff --git a/libargp/muinit.c b/libargp/muinit.c index efe8bd3c6..7c797ce28 100644 --- a/libargp/muinit.c +++ b/libargp/muinit.c @@ -38,22 +38,24 @@ mu_app_init (struct argp *myargp, const char **capa, int rc, i; struct argp *argp; const struct argp argpnull = { 0 }; - + char **excapa; + mu_set_program_name (argv[0]); mu_libargp_init (); for (i = 0; capa[i]; i++) mu_gocs_register_std (capa[i]); /*FIXME*/ if (!myargp) myargp = &argpnull; - argp = mu_argp_build (myargp); + argp = mu_argp_build (myargp, &excapa); rc = argp_parse (argp, argc, argv, flags, pindex, data); mu_argp_done (argp); if (rc) return rc; - mu_libcfg_init (capa); + mu_libcfg_init (excapa); + free (excapa); mu_parse_config_files (cfg_param); - + mu_gocs_flush (); return 0; |