]> git.sesse.net Git - vlc/commitdiff
Handle -v correctly (i.e. as most other programs do)
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Mar 2010 20:12:02 +0000 (22:12 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Mar 2010 20:12:02 +0000 (22:12 +0200)
src/config/cmdline.c

index 2710f801fb6c17a04efe154b08bc1df535b887e1..9174a4fabacc6df064fea6e031912fec76a73855 100644 (file)
@@ -178,16 +178,11 @@ int config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
                 pp_shortopts[(int)p_item->i_short] = p_item;
                 psz_shortopts[i_shortopts] = p_item->i_short;
                 i_shortopts++;
-                if( p_item->i_type != CONFIG_ITEM_BOOL )
+                if( p_item->i_type != CONFIG_ITEM_BOOL
+                 && p_item->i_short != 'v' )
                 {
                     psz_shortopts[i_shortopts] = ':';
                     i_shortopts++;
-
-                    if( p_item->i_short == 'v' )
-                    {
-                        psz_shortopts[i_shortopts] = ':';
-                        i_shortopts++;
-                    }
                 }
             }
         }
@@ -308,26 +303,7 @@ int config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
                     var_Create( p_this, name, VLC_VAR_INTEGER );
                     if( i_cmd == 'v' )
                     {
-                        if( vlc_optarg )
-                        {
-                            if( *vlc_optarg == 'v' ) /* eg. -vvv */
-                            {
-                                i_verbose++;
-                                while( *vlc_optarg == 'v' )
-                                {
-                                    i_verbose++;
-                                    vlc_optarg++;
-                                }
-                            }
-                            else
-                            {
-                                i_verbose += atoi( vlc_optarg ); /* eg. -v2 */
-                            }
-                        }
-                        else
-                        {
-                            i_verbose++; /* -v */
-                        }
+                        i_verbose++; /* -v */
                         var_SetInteger( p_this, name, i_verbose );
                     }
                     else