[vlc-commits] commit: Handle -v correctly (i.e. as most other programs do) ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Mar 2 21:12:26 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Mar  2 22:12:02 2010 +0200| [0e4feb1e125ca3446306835a6d7c8c340f6d9111] | committer: Rémi Denis-Courmont 

Handle -v correctly (i.e. as most other programs do)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e4feb1e125ca3446306835a6d7c8c340f6d9111
---

 src/config/cmdline.c |   30 +++---------------------------
 1 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/src/config/cmdline.c b/src/config/cmdline.c
index 2710f80..9174a4f 100644
--- a/src/config/cmdline.c
+++ b/src/config/cmdline.c
@@ -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



More information about the vlc-commits mailing list