Index: trunk/src/hid_init.c =================================================================== --- trunk/src/hid_init.c (revision 27387) +++ trunk/src/hid_init.c (revision 27388) @@ -33,6 +33,8 @@ #include #include +#include + #include "hid.h" #include "hid_nogui.h" #include "event.h" @@ -51,6 +53,7 @@ #include "file_loaded.h" #include "hidlib.h" #include "hidlib_conf.h" +#include "conf.h" static const char *flt_any[] = {"*", "*.*", NULL}; @@ -304,10 +307,22 @@ pcb_color_init(); } +static vts0_t hidlib_conffile; + void pcb_hidlib_init2(const pup_buildin_t *buildins, const pup_buildin_t *local_buildins) { pcb_actions_init(); + /* load custom config files in the order they were specified */ + if (hidlib_conffile.used > 0) { + int n; + for(n = 0; n < hidlib_conffile.used; n++) { + pcb_conf_load_as(CFR_CLI, hidlib_conffile.array[n], 0); + free(hidlib_conffile.array[n]); + } + vts0_uninit(&hidlib_conffile); + } + pcb_conf_load_all(NULL, NULL); pup_init(&pcb_pup); @@ -484,6 +499,10 @@ } return 1; } + if (pcbhl_main_arg_match(cmd, "C", "-conffile")) { + vts0_append(&hidlib_conffile, pcb_strdup(arg)); + return 0; + } } /* didn't handle argument, save it for the HID */ ga->hid_argv[ga->hid_argc++] = orig_cmd; Index: trunk/src/main_act.c =================================================================== --- trunk/src/main_act.c (revision 27387) +++ trunk/src/main_act.c (revision 27388) @@ -157,6 +157,7 @@ u("\nGenerics:"); u("-c conf/path=value set the value of a configuration item (in CFR_CLI)"); + u("-C conffile load config file (as CFR_CLI; after all -c's)"); return 0; }