From: Zoran V. <vas...@us...> - 2005-04-09 16:30:11
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20827 Modified Files: nsmain.c Log Message: Cleanup command help text and parsing of args between Win/unix. Index: nsmain.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsmain.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nsmain.c 4 Apr 2005 02:39:47 -0000 1.6 --- nsmain.c 9 Apr 2005 16:30:02 -0000 1.7 *************** *** 199,203 **** for (optind = 1; optind < argc; optind++) { if (argv[optind][0] != '-') { ! break; } switch (argv[optind][1]) { --- 199,203 ---- for (optind = 1; optind < argc; optind++) { if (argv[optind][0] != '-') { ! break; } switch (argv[optind][1]) { *************** *** 207,212 **** case 'c': case 'f': - case 'i': - case 'w': case 'V': #ifdef _WIN32 --- 207,210 ---- *************** *** 214,223 **** case 'R': case 'S': #endif if (mode != 0) { #ifdef _WIN32 ! UsageError("only one of -c, -i, -f, -V, -I, -R, or -S may be specified"); #else ! UsageError("only one of -c, -i, -f, -w, or -V may be specified"); #endif } --- 212,226 ---- case 'R': case 'S': + #else + case 'i': + case 'w': #endif if (mode != 0) { #ifdef _WIN32 ! UsageError("only one of -h, -V, -c, -f, -I, -R, or -S" ! " may be specified"); #else ! UsageError("only one of -h, -V, -c, -f, -i, or -w" ! " may be specified"); #endif } *************** *** 239,243 **** } if (optind + 1 < argc) { ! nsconf.config = argv[++optind]; } else { UsageError("no parameter for -%c option", argv[optind][1]); --- 242,246 ---- } if (optind + 1 < argc) { ! nsconf.config = argv[++optind]; } else { UsageError("no parameter for -%c option", argv[optind][1]); *************** *** 1038,1045 **** } fprintf(stderr, "\n" - "Usage: %s [-h|V] [-c|-i|f] " #ifdef _WIN32 ! "[-I|R] " #else "[-u <user>] [-g <group>] [-r <path>] [-b <address:port>|-B <file>] " #endif --- 1041,1048 ---- } fprintf(stderr, "\n" #ifdef _WIN32 ! "Usage: %s [-h|V] [-c|f|I|R|S] " #else + "Usage: %s [-h|V] [-c|f|i|w] " "[-u <user>] [-g <group>] [-r <path>] [-b <address:port>|-B <file>] " #endif *************** *** 1048,1059 **** " -h help (this message)\n" " -V version and release information\n" ! " -c command mode\n" ! " -i inittab mode\n" " -f foreground mode\n" - " -w watchdog mode: restart a failed server\n" #ifdef _WIN32 ! " -I Install win32 service\n" ! " -R Remove win32 service\n" #else " -d debugger-friendly mode (ignore SIGINT)\n" " -u run as <user>\n" --- 1051,1063 ---- " -h help (this message)\n" " -V version and release information\n" ! " -c command (interactive) mode\n" " -f foreground mode\n" #ifdef _WIN32 ! " -I install Win32 service\n" ! " -R remove Win32 service\n" ! " -S start Win32 service\n" #else + " -i inittab mode\n" + " -w watchdog mode (restart a failed server)\n" " -d debugger-friendly mode (ignore SIGINT)\n" " -u run as <user>\n" *************** *** 1103,1106 **** --- 1107,1111 ---- return config; } + #ifndef _WIN32 /* *************** *** 1285,1286 **** --- 1290,1292 ---- return 0; } + #endif /* _WIN32 */ |