summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Roelandt <tipecaml@gmail.com>2013-07-08 09:07:27 (GMT)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-08 09:07:27 (GMT)
commitc5f9985dfdbf8231fc61193ca9467a01cf6af375 (patch)
tree5fe5f98f6486a6d96bebf54a74130d9860c1951f
parentd42c52e86271b102cbc2fd94a99350364393e705 (diff)
Gracefully handle the errors using argp_error instead of error.
* options.c (argp_parse_common_options): Gracefully handle the errors using argp_error instead of error.
-rw-r--r--options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/options.c b/options.c
index b1f1620..156bcbf 100644
--- a/options.c
+++ b/options.c
@@ -116,7 +116,7 @@ argp_parse_common_options (int key, char *arg, struct argp_state *state)
case OPT_STOW: /* --stow */
err = stow_diradd (arg, ulfs_flags, &ulfs_patternlist, ulfs_priority);
if (err)
- error (EXIT_FAILURE, err, "stow_diradd");
+ argp_error (state, "stow_diradd");
ulfs_modified = 1;
ulfs_flags = ulfs_mode = ulfs_priority = 0;
ulfs_match = 0;
@@ -136,7 +136,7 @@ argp_parse_common_options (int key, char *arg, struct argp_state *state)
else
err = ulfs_register (arg, ulfs_flags, ulfs_priority);
if (err)
- error (EXIT_FAILURE, err, "ulfs_register");
+ argp_error (state, "ulfs_register");
ulfs_modified = 1;
ulfs_flags = ulfs_mode = ulfs_priority = 0;
ulfs_match = 0;