X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=clients%2Fgui-shell%2Flaunch.c;h=5cf716ab5e6f9898a03e22d48f5c35ba21be6dcb;hb=4a0e3628458792dabc51d51a2a9e3a7da191fae4;hp=c23b130555964af7364823386079899afbc74b81;hpb=34d45a1577a7696d68d683964d891b73fccfca50;p=doldaconnect.git diff --git a/clients/gui-shell/launch.c b/clients/gui-shell/launch.c index c23b130..5cf716a 100644 --- a/clients/gui-shell/launch.c +++ b/clients/gui-shell/launch.c @@ -48,8 +48,30 @@ int running(char *pf) int main(int argc, char **argv) { + int c; char cf[1024], pf[1024]; + while((c = getopt(argc, argv, "hV")) != -1) { + switch(c) { + case 'h': + printf("usage: dolcon-launch [-hV]\n"); + printf("\t-h\tDisplay this help message\n"); + printf("\t-V\tDisplay version info and exit\n"); + printf("\n"); + printf("\tIf $HOME/.doldacond.conf does not exist, dolcon-launch will run\n"); + printf("\tdolconf. Otherwise, if $HOME/.doldacond.pid does not exist,\n"); + printf("\tor does not contain a valid PID, dolcon-launch will run\n"); + printf("\tdoldacond-shell. Otherwise, dolcon-launch will run dolcon. All\n"); + printf("\tthese programs must be somewhere in $PATH for dolcon-launch to work.\n"); + exit(0); + case 'V': + printf("%s", RELEASEINFO); + exit(0); + default: + fprintf(stderr, "usage: dolcon-launch [-h]\n"); + exit(1); + } + } if(getenv("HOME") != NULL) snprintf(cf, sizeof(cf), "%s/.doldacond.conf", getenv("HOME")); else @@ -65,7 +87,7 @@ int main(int argc, char **argv) execlp("doldacond-shell", "doldacond-shell", NULL); perror("doldacond-shell"); } else { - execlp("dolcon", "dolcon", NULL); + execlp("dolcon", "dolcon", "-l", NULL); perror("dolcon"); } return(127);