1structure mkmkcline =
2struct
3
4fun usage() =
5    (TextIO.output(TextIO.stdErr,
6                   "Usage: \n  " ^ CommandLine.name() ^
7                   " [-o filename] [-static] [theory1 theory2 ...]\n");
8     OS.Process.exit OS.Process.failure)
9
10
11fun read_cline() =
12    case CommandLine.arguments() of
13      ["-o"] => usage()
14    | "-static" :: rest => (NONE, rest, true)
15    | "-o" :: file :: "-static" :: rest => (SOME file, rest, true)
16    | "-o" :: file :: rest => (SOME file, rest, false)
17    | x => (NONE, x, false)
18
19end (* struct *)
20