win32gui: -s and -? on the command line
Since -s doesn't function properly under the WIN32 graphical interface as yet, disable it altogether. Also clean up nhusage() so that it does work with the WIN32 graphical interface.
This commit is contained in:
+25
-15
@@ -217,12 +217,17 @@ char *argv[];
|
|||||||
* may do a prscore().
|
* may do a prscore().
|
||||||
*/
|
*/
|
||||||
if (!strncmp(argv[1], "-s", 2)) {
|
if (!strncmp(argv[1], "-s", 2)) {
|
||||||
#ifdef CHDIR
|
#if !defined(MSWIN_GRAPHICS)
|
||||||
|
# ifdef CHDIR
|
||||||
chdirx(hackdir,0);
|
chdirx(hackdir,0);
|
||||||
#endif
|
# endif
|
||||||
prscore(argc, argv);
|
prscore(argc, argv);
|
||||||
|
#else
|
||||||
|
raw_printf("-s is not supported for the Graphical Interface\n");
|
||||||
|
#endif /*MSWIN_GRAPHICS*/
|
||||||
nethack_exit(EXIT_SUCCESS);
|
nethack_exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't initialize the window system just to print usage */
|
/* Don't initialize the window system just to print usage */
|
||||||
if (!strncmp(argv[1], "-?", 2) || !strncmp(argv[1], "/?", 2)) {
|
if (!strncmp(argv[1], "-?", 2) || !strncmp(argv[1], "/?", 2)) {
|
||||||
nhusage();
|
nhusage();
|
||||||
@@ -555,39 +560,44 @@ char *argv[];
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
nhusage()
|
nhusage()
|
||||||
{
|
{
|
||||||
char buf1[BUFSZ];
|
char buf1[BUFSZ], buf2[BUFSZ], *bufptr;
|
||||||
|
|
||||||
|
buf1[0] = '\0';
|
||||||
|
bufptr = buf1;
|
||||||
|
|
||||||
|
#define ADD_USAGE(s) if (strlen(buf1) < ((BUFSZ - strlen(s)) + 1)) Strcat(bufptr, s);
|
||||||
|
|
||||||
/* -role still works for those cases which aren't already taken, but
|
/* -role still works for those cases which aren't already taken, but
|
||||||
* is deprecated and will not be listed here.
|
* is deprecated and will not be listed here.
|
||||||
*/
|
*/
|
||||||
(void) Sprintf(buf1,
|
(void) Sprintf(buf2,
|
||||||
"\nUsage: %s [-d dir] -s [-r race] [-p profession] [maxrank] [name]...\n or",
|
"\nUsage:\n%s [-d dir] -s [-r race] [-p profession] [maxrank] [name]...\n or",
|
||||||
hname);
|
hname);
|
||||||
if (!iflags.window_inited)
|
ADD_USAGE(buf2);
|
||||||
raw_printf(buf1);
|
|
||||||
else
|
(void) Sprintf(buf2,
|
||||||
(void) printf(buf1);
|
"\n%s [-d dir] [-u name] [-r race] [-p profession] [-[DX]]",
|
||||||
(void) Sprintf(buf1,
|
|
||||||
"\n %s [-d dir] [-u name] [-r race] [-p profession] [-[DX]]",
|
|
||||||
hname);
|
hname);
|
||||||
|
ADD_USAGE(buf2);
|
||||||
#ifdef NEWS
|
#ifdef NEWS
|
||||||
Strcat(buf1," [-n]");
|
ADD_USAGE(" [-n]");
|
||||||
#endif
|
#endif
|
||||||
#ifndef AMIGA
|
#ifndef AMIGA
|
||||||
Strcat(buf1," [-I] [-i] [-d]");
|
ADD_USAGE(" [-I] [-i] [-d]");
|
||||||
#endif
|
#endif
|
||||||
#ifdef MFLOPPY
|
#ifdef MFLOPPY
|
||||||
# ifndef AMIGA
|
# ifndef AMIGA
|
||||||
Strcat(buf1," [-R]");
|
ADD_USAGE(" [-R]");
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef AMIGA
|
#ifdef AMIGA
|
||||||
Strcat(buf1," [-[lL]]");
|
ADD_USAGE(" [-[lL]]");
|
||||||
#endif
|
#endif
|
||||||
if (!iflags.window_inited)
|
if (!iflags.window_inited)
|
||||||
raw_printf("%s\n",buf1);
|
raw_printf("%s\n",buf1);
|
||||||
else
|
else
|
||||||
(void) printf("%s\n",buf1);
|
(void) printf("%s\n",buf1);
|
||||||
|
#undef ADD_USAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHDIR
|
#ifdef CHDIR
|
||||||
|
|||||||
Reference in New Issue
Block a user