/[mailutils]/mailutils/mailbox/mu_argp.c
ViewVC logotype

Diff of /mailutils/mailbox/mu_argp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by gray, Tue Aug 13 13:25:15 2002 UTC revision 1.7 by gray, Wed Aug 21 15:31:51 2002 UTC
# Line 48  Line 48 
48    
49  #define ARG_LOG_FACILITY 1  #define ARG_LOG_FACILITY 1
50  #define ARG_LOCK_FLAGS 2  #define ARG_LOCK_FLAGS 2
51    #define ARG_SHOW_OPTIONS 3
52    
53  const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";  const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
54    
55  static struct argp_option mu_common_argp_options[] =  static struct argp_option mu_common_argp_options[] =
56  {  {
57    { NULL, 0, NULL, 0, "Common options", 0},    { NULL, 0, NULL, 0, "Common options", 0},
58      { "show-config-options", ARG_SHOW_OPTIONS, NULL, OPTION_HIDDEN,
59        "Show compilation options", 0 },
60    { NULL, 0, NULL, 0, NULL, 0 }    { NULL, 0, NULL, 0, NULL, 0 }
61  };  };
62    
# Line 250  static char license_text[] = Line 253  static char license_text[] =
253      "   along with this program; if not, write to the Free Software\n"      "   along with this program; if not, write to the Free Software\n"
254      "   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n";      "   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n";
255    
256    static char *mu_conf_option[] = {
257      "VERSION=" VERSION,
258    #ifdef USE_LIBPAM
259      "USE_LIBPAM",
260    #endif
261    #ifdef USE_VIRTUAL_DOMAINS
262      "USE_VIRTUAL_DOMAINS",
263    #endif
264    #ifdef WITH_BDB2
265      "WITH_BDB2",
266    #endif
267    #ifdef WITH_NDBM
268      "WITH_NDBM",
269    #endif
270    #ifdef WITH_OLD_DBM
271      "WITH_OLD_DBM",
272    #endif
273    #ifdef WITH_GDBM
274      "WITH_GDBM",
275    #endif
276    #ifdef WITH_GSSAPI
277      "WITH_GSSAPI",
278    #endif
279    #ifdef WITH_GUILE
280      "WITH_GUILE",
281    #endif
282    #ifdef WITH_PTHREAD
283      "WITH_PTHREAD",
284    #endif
285    #ifdef WITH_READLINE
286      "WITH_READLINE",
287    #endif
288    #ifdef HAVE_MYSQL
289      "HAVE_MYSQL",
290    #endif
291      NULL
292    };
293    
294    static void
295    show_options()
296    {
297      int i;
298      
299      for (i = 0; mu_conf_option[i]; i++)
300        printf ("%s\n", mu_conf_option[i]);
301    }
302    
303  static error_t  static error_t
304  mu_common_argp_parser (int key, char *arg, struct argp_state *state)  mu_common_argp_parser (int key, char *arg, struct argp_state *state)
305  {  {
# Line 264  mu_common_argp_parser (int key, char *ar Line 314  mu_common_argp_parser (int key, char *ar
314        printf ("%s", license_text);        printf ("%s", license_text);
315        exit (0);        exit (0);
316    
317        case ARG_SHOW_OPTIONS:
318          show_options ();
319          exit (0);
320          
321        /* mailbox */        /* mailbox */
322      case 'm':      case 'm':
323        mu_path_maildir = arg;        mu_path_maildir = arg;
# Line 752  mu_argp_parse(const struct argp *argp, Line 806  mu_argp_parse(const struct argp *argp,
806    
807    if(!argp)    if(!argp)
808      argp = &argpnull;      argp = &argpnull;
809      
810    argp = mu_build_argp (argp, capa);    argp = mu_build_argp (argp, capa);
811    mu_create_argcv (capa, *pargc, *pargv, pargc, pargv);    mu_create_argcv (capa, *pargc, *pargv, pargc, pargv);
812    ret = argp_parse (argp, *pargc, *pargv, flags, arg_index, input);    ret = argp_parse (argp, *pargc, *pargv, flags, arg_index, input);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26