From 4d5114932950c5ac16e44cdb77cf0a175b4c1d64 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 8 Jul 2013 11:04:34 +0200 Subject: Gracefully handle the errors using argp_error instead of error * tarfs.c (tarfs_parse_opts): Gracefully handle the errors using argp_error instead of error. --- ChangeLog | 5 +++++ tarfs.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b74d0c041..8aa4197da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-07-05 Cyril Roelandt + + * tarfs.c (tarfs_parse_opts): Gracefully handle the errors using + argp_error instead of error. + 2006-03-08 Ben Asselstine * tar.c (tar_header2stat): Correctly setting `st_blocks' of ST. diff --git a/tarfs.c b/tarfs.c index 8ff1060f5..4a082643d 100644 --- a/tarfs.c +++ b/tarfs.c @@ -211,7 +211,7 @@ tarfs_parse_opts (int key, char *arg, struct argp_state *sate) case ARGP_KEY_ARG: tarfs_options.file_name = strdup (arg); if (!tarfs_options.file_name || !strlen (tarfs_options.file_name)) - error (1, 1, "No archive specified."); + argp_error (sate, "No archive specified."); } return 0; -- cgit v1.2.3