Change switch_help from array of strings to plain string

This commit is contained in:
Kevin Easton
2017-12-01 23:42:04 +11:00
parent 035063abce
commit cdf53cbf86

View File

@@ -209,42 +209,42 @@ static volatile int cntl_c_hit = 0;
char version[] = _VERSION_; char version[] = _VERSION_;
static char *switch_help[] = { static const char * const switch_help =
"Usage: BitchX [switches] [nickname] [server list] \n", "Usage: BitchX [switches] [nickname] [server list] \n"
" The [nickname] can be at most 15 characters long\n", " The [nickname] can be at most 15 characters long\n"
" The [server list] is a whitespace separate list of server name\n", " The [server list] is a whitespace separate list of server name\n"
" The [switches] may be any or all of the following\n", " The [switches] may be any or all of the following\n"
#ifndef WINNT #ifndef WINNT
" -H <hostname>\tuses the virtual hostname if possible\n", " -H <hostname>\tuses the virtual hostname if possible\n"
#endif #endif
" -N do not auto-connect to the first server\n", " -N do not auto-connect to the first server\n"
" -A do not display the startup ansi\n", " -A do not display the startup ansi\n"
" -c <channel>\tjoins <channel> on startup. don\'t forget to escape the # using \\\n", " -c <channel>\tjoins <channel> on startup. don\'t forget to escape the # using \\\n"
" -b\t\tload " BITCHXRC_NAME " or " IRCRC_NAME " after connecting to a server\n", " -b\t\tload " BITCHXRC_NAME " or " IRCRC_NAME " after connecting to a server\n"
" -p <port>\tdefault server connection port (usually 6667)\n", " -p <port>\tdefault server connection port (usually 6667)\n"
#ifndef WINNT #ifndef WINNT
" -f\t\tyour terminal uses flow controls (^S/^Q), so BitchX shouldn't\n", " -f\t\tyour terminal uses flow controls (^S/^Q), so BitchX shouldn't\n"
" -F\t\tyour terminal doesn't use flow control (default)\n", " -F\t\tyour terminal doesn't use flow control (default)\n"
#endif #endif
" -d\t\truns BitchX in \"dumb\" terminal mode\n", " -d\t\truns BitchX in \"dumb\" terminal mode\n"
" -q\t\tdoes not load ~/" IRCRC_NAME "\n", " -q\t\tdoes not load ~/" IRCRC_NAME "\n"
" -r file\tload file as list of servers\n", " -r file\tload file as list of servers\n"
" -n nickname\tnickname to use\n", " -n nickname\tnickname to use\n"
" -a\t\tadds default servers and command line servers to server list\n", " -a\t\tadds default servers and command line servers to server list\n"
" -x\t\truns BitchX in \"debug\" mode\n", " -x\t\truns BitchX in \"debug\" mode\n"
" -Z\t\tuse NAT address when doing DCC\n", " -Z\t\tuse NAT address when doing DCC\n"
" -P\t\ttoggle check pid.nickname for running program\n", " -P\t\ttoggle check pid.nickname for running program\n"
" -v\t\ttells you about the client's version\n", " -v\t\ttells you about the client's version\n"
#ifdef HAVE_LIBSSL #ifdef HAVE_LIBSSL
" -s\t\tnext server specified is SSL (may be used multiple times)\n", " -s\t\tnext server specified is SSL (may be used multiple times)\n"
#endif #endif
" -i\t\tignores the autojoin list entries\n", " -i\t\tignores the autojoin list entries\n"
" -l <file>\tloads <file> in place of your " IRCRC_NAME "\n\ " -l <file>\tloads <file> in place of your " IRCRC_NAME "\n"
-L <file>\tloads <file> in place of your " IRCRC_NAME " and expands $ expandos\n", " -L <file>\tloads <file> in place of your " IRCRC_NAME " and expands $ expandos\n"
#if !defined(WINNT) && !defined(__EMX__) #if !defined(WINNT) && !defined(__EMX__)
" -B\t\tforce BitchX to fork and return you to shell. pid check on.\n", " -B\t\tforce BitchX to fork and return you to shell. pid check on.\n"
#endif #endif
NULL }; ;
char *time_format = NULL; /* XXX Bogus XXX */ char *time_format = NULL; /* XXX Bogus XXX */
#ifdef __EMX__ #ifdef __EMX__
@@ -918,16 +918,8 @@ static char *parse_args (char *argv[], int argc, char **envp)
default: default:
fprintf(stderr, "Unknown flag: %s\n",argv[ac]); fprintf(stderr, "Unknown flag: %s\n",argv[ac]);
case 'h': case 'h':
{ fputs(switch_help, stderr);
int t = 0; exit(1);
while(switch_help[t])
{
fprintf(stderr, "%s", switch_help[t]);
t++;
}
exit(1);
}
} /* End of switch */ } /* End of switch */
} }
else else