home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / IYONIX / MANICMINER / SOURCE.ZIP / manicminer-1.6.3 / c / cmdline next >
Encoding:
Text File  |  2000-12-03  |  1.3 KB  |  56 lines

  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include "manic.h"
  4.  
  5. void
  6. version (void)
  7. {
  8.   printf ("\n"
  9.       "Manic Miner CP %s\n"
  10.       "Andy Noble (andy@andyn.demon.co.uk)\n"
  11.       "Stuart Brady (stuart@wholehog.fsnet.co.uk)\n"
  12.       "Darren Salt (ds@youmustbejoking.demon.co.uk)\n"
  13.       "\n", VERSION);
  14.   exit (0);
  15. }
  16.  
  17. static void
  18. usage (void)
  19. {
  20.   printf ("\n"
  21.       "  -f  --file    <name>  use <name> for level data\n"
  22.       "  -h  --help         this screen\n"
  23.       "  -v  --version      version details\n"
  24.       "  -fs                force sound configuration\n"
  25.       "  -rh                reset high score\n"
  26.       "  -2                 640x480 display [Allegro only]\n"
  27.       "\n");
  28.   exit (0);
  29. }
  30.  
  31. void
  32. cmdline (int argc, const char *const argv[])
  33. {
  34.   int i = 0;
  35.  
  36.   while (++i < argc) {
  37.     if ((!strcmp (argv[i], "-h")) || (!strcmp (argv[i], "--help")))
  38.       usage ();
  39.     else if ((!strcmp (argv[i], "-v")) || (!strcmp (argv[i], "--version")))
  40.       version ();
  41.     else if ((!strcmp (argv[i], "-f")) || (!strcmp (argv[i], "--file")))
  42.       dataname = argv[++i];
  43.     else if (!strcmp (argv[i], "-fs"))
  44.       FORCE = 1;
  45.     else if (!strcmp (argv[i], "-rh"))
  46.       ResetHigh = 1;
  47.     else if (!strcmp (argv[i], "-2"))
  48.       DoubleSize = 1;
  49.     else {
  50.       printf ("Bad option: %s", argv[i]);
  51.       usage ();
  52.       exit (-1);
  53.     }
  54.   }
  55. }
  56.