home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <string.h>
- #include "manic.h"
-
- void
- version (void)
- {
- printf ("\n"
- "Manic Miner CP %s\n"
- "Andy Noble (andy@andyn.demon.co.uk)\n"
- "Stuart Brady (stuart@wholehog.fsnet.co.uk)\n"
- "Darren Salt (ds@youmustbejoking.demon.co.uk)\n"
- "\n", VERSION);
- exit (0);
- }
-
- static void
- usage (void)
- {
- printf ("\n"
- " -f --file <name> use <name> for level data\n"
- " -h --help this screen\n"
- " -v --version version details\n"
- " -fs force sound configuration\n"
- " -rh reset high score\n"
- " -2 640x480 display [Allegro only]\n"
- "\n");
- exit (0);
- }
-
- void
- cmdline (int argc, const char *const argv[])
- {
- int i = 0;
-
- while (++i < argc) {
- if ((!strcmp (argv[i], "-h")) || (!strcmp (argv[i], "--help")))
- usage ();
- else if ((!strcmp (argv[i], "-v")) || (!strcmp (argv[i], "--version")))
- version ();
- else if ((!strcmp (argv[i], "-f")) || (!strcmp (argv[i], "--file")))
- dataname = argv[++i];
- else if (!strcmp (argv[i], "-fs"))
- FORCE = 1;
- else if (!strcmp (argv[i], "-rh"))
- ResetHigh = 1;
- else if (!strcmp (argv[i], "-2"))
- DoubleSize = 1;
- else {
- printf ("Bad option: %s", argv[i]);
- usage ();
- exit (-1);
- }
- }
- }
-