Added file argument

pull/58/head
parent 7268c7d612
commit 03b2a21635
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -420,11 +420,12 @@ int yon_ubl_setup_arguments(int argc, char *argv[],config_str *unfound_arguments
{"socket-trd-id", 1,0, 't'}, {"socket-trd-id", 1,0, 't'},
{"clear-config", 0,0, 'c'}, {"clear-config", 0,0, 'c'},
{"debug", 0,0, 'd'}, {"debug", 0,0, 'd'},
{"file", 1, 0, 'f'},
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
config_str unregistered_arguments=NULL; config_str unregistered_arguments=NULL;
for (int i=1;i<argc;i++){ for (int i=1;i<argc;i++){
int argument=getopt_long(argc,argv,"hVvs:e:t:cd",long_options,&option_index); int argument=getopt_long(argc,argv,"hVvs:e:t:cdf:",long_options,&option_index);
switch(argument){ switch(argument){
case 'h': case 'h':
show_help=1; show_help=1;
@ -472,6 +473,11 @@ int yon_ubl_setup_arguments(int argc, char *argv[],config_str *unfound_arguments
case 6: case 6:
template_config->lock_load_system=1; template_config->lock_load_system=1;
break; break;
case 'f':
template_config->force_ini = yon_char_new(optarg);
template_config->config_load_path = template_config->force_ini;
template_config->config_save_path = template_config->force_ini;
break;
default: default:
char *unfound = optarg; char *unfound = optarg;
yon_char_parsed_add_or_create_if_exists(unregistered_arguments,arguments_size,yon_char_unite(argv[i],!yon_char_is_empty(unfound)?"=":"",!yon_char_is_empty(unfound)?unfound:"",NULL)); yon_char_parsed_add_or_create_if_exists(unregistered_arguments,arguments_size,yon_char_unite(argv[i],!yon_char_is_empty(unfound)?"=":"",!yon_char_is_empty(unfound)?unfound:"",NULL));

@ -137,7 +137,10 @@ extern template_app_info template_app_information;
\ \
int always_open_documentation;\ int always_open_documentation;\
int debug_mode;\ int debug_mode;\
char *custom_load_path; char *custom_load_path;\
char *force_ini;\
char *config_load_path;\
char *config_save_path;
typedef struct { typedef struct {
template_config_fields template_config_fields

Loading…
Cancel
Save