diff options
author | Roland McGrath <roland@gnu.org> | 2001-01-16 11:36:26 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-01-16 11:36:26 +0000 |
commit | 600a46782cd5d273e9afeda26e926944faecf13a (patch) | |
tree | f21a173bbafc122dfaa2de5fa26b655c1cad31e8 /libstore/argp.c | |
parent | f31d77ceb18f1b69e18520c51524b9bfc9fac9b0 (diff) | |
download | hurd-600a46782cd5d273e9afeda26e926944faecf13a.tar.gz hurd-600a46782cd5d273e9afeda26e926944faecf13a.tar.bz2 hurd-600a46782cd5d273e9afeda26e926944faecf13a.zip |
2001-01-16 Roland McGrath <roland@frob.com>
* store.h (struct store_argp_params): Add member `store_optional'.
* argp.c (parse_opt): If store_optional is set, don't make it an error
when there are no store arguments and the type doesn't validate that.
Diffstat (limited to 'libstore/argp.c')
-rw-r--r-- | libstore/argp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libstore/argp.c b/libstore/argp.c index 1ebd32a2..058d8276 100644 --- a/libstore/argp.c +++ b/libstore/argp.c @@ -1,7 +1,7 @@ /* Store argument parsing - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. - Written by Miles Bader <miles@gnu.ai.mit.edu> + Copyright (C) 1996,97,98,99,2001 Free Software Foundation, Inc. + Written by Miles Bader <miles@gnu.org> This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or @@ -361,11 +361,13 @@ parse_opt (int opt, char *arg, struct argp_state *state) && (!parsed->type->validate_name || (*parsed->type->validate_name) (0, parsed->classes) != 0)) { + struct store_argp_params *params = state->input; store_parsed_free (parsed); - PERR (EINVAL, "No store specified"); + if (!params->store_optional) + PERR (EINVAL, "No store specified"); + parsed = 0; } - else - ((struct store_argp_params *)state->input)->result = parsed; + ((struct store_argp_params *)state->input)->result = parsed; break; default: |