* configuration.c management of the modules configuration
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: configuration.c,v 1.38 2002/08/20 18:25:42 sam Exp $
+ * $Id: configuration.c,v 1.42 2002/11/09 17:44:09 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
# include <getopt.h> /* getopt() */
# endif
#else
-# include "GNUgetopt/getopt.h"
+# include "../extras/getopt.h"
#endif
#if defined(HAVE_GETPWUID)
int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[],
vlc_bool_t b_ignore_errors )
{
- int i_cmd, i_index, i_opts, i_shortopts, flag;
+ int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0;
module_t **pp_parser;
vlc_list_t *p_list;
module_config_t *p_item;
{
psz_shortopts[i_shortopts] = ':';
i_shortopts++;
+
+ if( p_item->i_short == 'v' )
+ {
+ psz_shortopts[i_shortopts] = ':';
+ i_shortopts++;
+ }
}
}
}
config_PutPsz( p_this, pp_shortopts[i_cmd]->psz_name, optarg );
break;
case CONFIG_ITEM_INTEGER:
- config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
- atoi(optarg));
+ if( i_cmd == 'v' )
+ {
+ if( optarg )
+ {
+ if( *optarg == 'v' ) /* eg. -vvv */
+ {
+ i_verbose++;
+ while( *optarg == 'v' )
+ {
+ i_verbose++;
+ optarg++;
+ }
+ }
+ else
+ {
+ i_verbose += atoi( optarg ); /* eg. -v2 */
+ }
+ }
+ else
+ {
+ i_verbose++; /* -v */
+ }
+ config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
+ i_verbose );
+ }
+ else
+ {
+ config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name,
+ atoi(optarg) );
+ }
break;
case CONFIG_ITEM_BOOL:
config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name, 1 );