]> git.sesse.net Git - vlc/commitdiff
* ./src/misc/configuration.c: when an invalid short option is found, use
authorSam Hocevar <sam@videolan.org>
Thu, 30 Jan 2003 20:59:36 +0000 (20:59 +0000)
committerSam Hocevar <sam@videolan.org>
Thu, 30 Jan 2003 20:59:36 +0000 (20:59 +0000)
    the optopt variable instead of the current value of optind (Closes: #148).

src/misc/configuration.c

index 7035bb75c2d4263acab12e6b69f20ef319d17a99..04efb87638c13f8195ff996cc29b9cb2be079eaa 100644 (file)
@@ -2,7 +2,7 @@
  * configuration.c management of the modules configuration
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.49 2003/01/27 17:41:01 ipkiss Exp $
+ * $Id: configuration.c,v 1.50 2003/01/30 20:59:36 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -1224,7 +1224,16 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
         /* Internal error: unknown option */
         if( !b_ignore_errors )
         {
-            fprintf( stderr, "unknown option `%s'\n", ppsz_argv[optind-1] );
+            fprintf( stderr, "%s: unknown option ",
+                             p_this->p_vlc->psz_object_name );
+            if( optopt )
+            {
+                fprintf( stderr, "`-%c'\n", optopt );
+            }
+            else
+            {
+                fprintf( stderr, "`%s'\n", ppsz_argv[optind-1] );
+            }
             fprintf( stderr, "Try `%s --help' for more information.\n",
                              p_this->p_vlc->psz_object_name );