diff options
author | Miles Bader <miles@gnu.org> | 1996-06-20 03:25:10 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-06-20 03:25:10 +0000 |
commit | 43069c8da7d9478d749d9b54942fb05d5fd3b65b (patch) | |
tree | 487db9fa36bb94223b24d343cbffb17e60558e21 /libdiskfs | |
parent | ac3e7fcf2a079192c439f323bb76d434bbec18e2 (diff) |
(parse_dev_startup_opt): Use argp_error.
(diskfs_std_startup_argp): Renamed from startup_argp, exported.
(diskfs_std_device_startup_argp): Renamed from dev_startup_argp, exported.
(diskfs_startup_arg, diskfs_device_startup_arg): Variable removed.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/opts-std-startup.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libdiskfs/opts-std-startup.c b/libdiskfs/opts-std-startup.c index 929c4147..28d98c5d 100644 --- a/libdiskfs/opts-std-startup.c +++ b/libdiskfs/opts-std-startup.c @@ -102,10 +102,12 @@ static const struct argp startup_common_argp = /* This may be used with argp_parse to parse standard diskfs startup options, possible chained onto the end of a user argp structure. */ static const struct argp *startup_argp_parents[] = { &startup_common_argp, 0 }; -static const struct argp startup_argp = - { startup_options, parse_startup_opt, 0, 0, startup_argp_parents }; -const struct argp *diskfs_startup_argp = &startup_argp; +const struct argp +diskfs_std_startup_argp = +{ + startup_options, parse_startup_opt, 0, 0, startup_argp_parents +}; /* ---------------------------------------------------------------- */ @@ -137,8 +139,8 @@ parse_dev_startup_opt (int opt, char *arg, struct argp_state *state) break; case ARGP_KEY_NO_ARGS: - fprintf (stderr, "%s: No device specified\n", program_invocation_name); - argp_help (state->argp, stderr, ARGP_HELP_STD_ERR); /* exits */ + argp_error (state, "No device specified"); + return EINVAL; default: return ARGP_ERR_UNKNOWN; @@ -147,9 +149,9 @@ parse_dev_startup_opt (int opt, char *arg, struct argp_state *state) return 0; } -static const struct argp *dev_startup_argp_parents[] = { &startup_argp, 0 }; -static const struct argp dev_startup_argp = +static const struct argp *dev_startup_argp_parents[] = + { &diskfs_std_startup_argp, 0 }; + +const struct argp diskfs_std_device_startup_argp = { dev_startup_options, parse_dev_startup_opt, "DEVICE", 0, dev_startup_argp_parents }; - -const struct argp *diskfs_device_startup_argp = &dev_startup_argp; |