X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=ecf36dd044159235ee7dee6701eb6ec912f9fabe;hb=38d1b8471964ebf9d4da576d74a452dc3a12b057;hp=20eeaff81af08239c2e29fd09ecf2ebf18a18add;hpb=17b0eca6e7ae464778c2fa896710724908c6f0c1;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index 20eeaff..ecf36dd 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -800,6 +800,23 @@ main (int argc, char **argv) } #endif + if(argc > 1 && !strcmp(argv[1], "--show-config")) { // [HGM] install: called to print config info + typedef struct {char *name, *value; } Config; + static Config configList[] = { + { "Datadir", DATADIR }, + { "Sysconfdir", SYSCONFDIR }, + { NULL } + }; + int i; + + for(i=0; configList[i].name; i++) { + if(argc > 2 && strcmp(argv[2], configList[i].name)) continue; + if(argc > 2) printf("%s", configList[i].value); + else printf("%-12s: %s\n", configList[i].name, configList[i].value); + } + exit(0); + } + /* set up keyboard accelerators group */ GtkAccelerators = gtk_accel_group_new(); @@ -1790,7 +1807,9 @@ void ManProc () { // called from menu #ifdef __APPLE__ - system("%s ./man.command", appData.sysOpen); + char buf[MSG_SIZ]; + snprintf(buf, MSG_SIZ, "%s ./man.command", appData.sysOpen); + system(buf); #else system("xterm -e man xboard &"); #endif