]> git.sesse.net Git - vlc/blobdiff - src/config/cmdline.c
Remove config_GetCacheDir
[vlc] / src / config / cmdline.c
index ad5f2ca4e8d1a0da1390f18746a162dc8e043a63..264f84ed2f9670e21e734439c44b84aeb67b1ad1 100644 (file)
@@ -27,7 +27,8 @@
 
 #include <vlc_common.h>
 #include "../libvlc.h"
-#include "vlc_keys.h"
+#include <vlc_keys.h>
+#include <vlc_charset.h>
 
 #ifdef HAVE_GETOPT_LONG
 #   ifdef HAVE_GETOPT_H
@@ -58,7 +59,6 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
     int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0;
     module_t *p_parser;
     struct option *p_longopts;
-    int i_modules_index;
     const char **argv_copy = NULL;
 
     /* Short options */
@@ -273,7 +273,14 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
 
                     psz_name = p_conf->psz_name;
                 }
-
+#ifdef __APPLE__
+                if( p_conf->i_type != CONFIG_ITEM_BOOL && !optarg )
+                {
+                    fprintf( stderr, "Warning: missing argument for option --%s\n", p_conf->psz_name );
+                    fprintf( stderr, "Try specifying options as '--optionname=value' instead of '--optionname value'\n" );
+                    continue;
+                }
+#endif
                 switch( p_conf->i_type )
                 {
                     case CONFIG_ITEM_STRING:
@@ -290,7 +297,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc,
                         config_PutInt( p_this, psz_name, strtol(optarg, 0, 0));
                         break;
                     case CONFIG_ITEM_FLOAT:
-                        config_PutFloat( p_this, psz_name, (float)atof(optarg) );
+                        config_PutFloat( p_this, psz_name, us_atof(optarg) );
                         break;
                     case CONFIG_ITEM_KEY:
                         config_PutInt( p_this, psz_name, ConfigStringToKey( optarg ) );