about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-02-07 23:20:05 +0000
committerUlrich Drepper <drepper@redhat.com>2005-02-07 23:20:05 +0000
commitdd1e8878722d0a270f6aecdfeb7374d310f36519 (patch)
treed64dbcb4fe3a69ef60087f5d0569dbdd7ec6485f
parent6aa10807fc96b185d0cd7c2d62df0e9c0de4c165 (diff)
downloadglibc-dd1e8878722d0a270f6aecdfeb7374d310f36519.tar.gz
glibc-dd1e8878722d0a270f6aecdfeb7374d310f36519.tar.xz
glibc-dd1e8878722d0a270f6aecdfeb7374d310f36519.zip
* iconv/iconv_prog.c (main): Provide more help in case on an error.
-rw-r--r--ChangeLog4
-rw-r--r--iconv/iconv_prog.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b62762f24..cc033e6be1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-07  Ulrich Drepper  <drepper@redhat.com>
+
+	* iconv/iconv_prog.c (main): Provide more help in case on an error.
+
 2005-02-07  Jakub Jelinek  <jakub@redhat.com>
 
 	* nscd/nscd.c (termination_handler): Avoid segfault if some database
diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index 52ae589b37..5b3d35ecaa 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -239,26 +239,30 @@ main (int argc, char *argv[])
 	      if (from_wrong)
 		{
 		  if (to_wrong)
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("\
 conversion from `%s' and to `%s' are not supported"),
 			   from_pretty, to_pretty);
 		  else
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("conversion from `%s' is not supported"),
 			   from_pretty);
 		}
 	      else
 		{
 		  if (to_wrong)
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("conversion to `%s' is not supported"),
 			   to_pretty);
 		  else
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("conversion from `%s' to `%s' is not supported"),
 			   from_pretty, to_pretty);
 		}
+
+	      argp_help (&argp, stderr, ARGP_HELP_SEE,
+			 program_invocation_short_name);
+	      exit (1);
 	    }
 	  else
 	    error (EXIT_FAILURE, errno,