X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xaw%2Fxboard.c;h=292f7c2320cbb98f2e016df5927eceb44fed76e5;hb=f1af1dfc236cea66f9a27d2a2e4b40dbecbfad71;hp=5b6501d0bb9a892f45672790a8a0629ad23a9ef5;hpb=7b739c3b0ba3187b11673c4b26e51a6e4af3c43e;p=xboard.git diff --git a/xaw/xboard.c b/xaw/xboard.c index 5b6501d..292f7c2 100644 --- a/xaw/xboard.c +++ b/xaw/xboard.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -203,6 +203,7 @@ extern char *getenv(); #include "gettext.h" #include "draw.h" +#define SLASH '/' #ifdef __EMX__ #ifndef HAVE_USLEEP @@ -819,6 +820,8 @@ PrintArg (ArgType t) case ArgTwo: case ArgNone: case ArgCommSettings: + case ArgMaster: + case ArgInstall: break; } return p; @@ -987,6 +990,23 @@ main (int argc, char **argv) exit(0); } + 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); + } + programName = strrchr(argv[0], '/'); if (programName == NULL) programName = argv[0];