MCPcopy Create free account
hub / github.com/NetHack/NetHack / process_options

Function process_options

sys/vms/vmsmain.c:252–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252static void
253process_options(int argc, char *argv[])
254{
255 int i;
256
257 /*
258 * Process options.
259 */
260 while (argc > 1 && argv[1][0] == '-') {
261 argv++;
262 argc--;
263 switch (argv[0][1]) {
264 case 'D':
265 wizard = TRUE, discover = FALSE;
266 break;
267 case 'X':
268 case 'x':
269 discover = TRUE, wizard = FALSE;
270 break;
271#ifdef NEWS
272 case 'n':
273 iflags.news = FALSE;
274 break;
275#endif
276 case 'u':
277 if (argv[0][2])
278 (void) strncpy(svp.plname, argv[0] + 2, sizeof(svp.plname) - 1);
279 else if (argc > 1) {
280 argc--;
281 argv++;
282 (void) strncpy(svp.plname, argv[0], sizeof(svp.plname) - 1);
283 } else
284 raw_print("Player name expected after -u");
285 break;
286 case 'I':
287 case 'i':
288 if (!strncmpi(argv[0] + 1, "IBM", 3)) {
289 load_symset("IBMGraphics", PRIMARYSET);
290 load_symset("RogueIBM", ROGUESET);
291 switch_symbols(TRUE);
292 }
293 break;
294 /* case 'D': */
295 case 'd':
296 if (!strncmpi(argv[0] + 1, "DEC", 3)) {
297 load_symset("DECGraphics", PRIMARYSET);
298 switch_symbols(TRUE);
299 }
300 break;
301 case 'p': /* profession (role) */
302 if (argv[0][2]) {
303 if ((i = str2role(&argv[0][2])) >= 0)
304 flags.initrole = i;
305 } else if (argc > 1) {
306 argc--;
307 argv++;
308 if ((i = str2role(argv[0])) >= 0)
309 flags.initrole = i;

Callers 1

mainFunction · 0.70

Calls 6

raw_printFunction · 0.85
load_symsetFunction · 0.85
switch_symbolsFunction · 0.85
str2roleFunction · 0.85
str2raceFunction · 0.85
strncmpiFunction · 0.50

Tested by

no test coverage detected