allow to specify ebook2cw.conf location with -E parameter

Note: ebook2cw *always* first searches ebook2cw.conf in
cwd and other common places, and then starts parsing the
command line parameters. If you specify the -E option,
the specified ebook2cw.conf will be loaded and it may
override settings previously made from the default
config file, or from other switches. The order at which
parameters are specified on the command line is honored.

Closes #2
This commit is contained in:
Fabian Kurz 2020-11-04 18:00:05 +01:00
parent 277cb4b0de
commit a3de8cc162
1 changed files with 6 additions and 2 deletions

View File

@ -272,7 +272,7 @@ int main (int argc, char** argv) {
readconfig(&cw);
while((i=getopt(argc,argv, "XOo:w:W:e:f:uc:k:Q:R:pF:s:b:q:a:t:y:S:hnT:N:B:C:g:d:l:"))!= -1){
while((i=getopt(argc,argv, "XOo:w:W:e:f:uc:k:Q:R:pF:s:b:q:a:t:y:S:hnT:N:B:C:g:d:l:E:"))!= -1){
setparameter(i, optarg, &cw);
}
@ -1331,7 +1331,11 @@ void setparameter (char i, char *value, CWP *cw) {
case 'C':
cw->bandpassfc = atoi(value);
break;
case 'E':
strncpy(cw->configfile, value, 78);
readconfig(cw);
break;
} /* switch */
}