diff options
Diffstat (limited to 'src/main.mlton.sml')
-rw-r--r-- | src/main.mlton.sml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.mlton.sml b/src/main.mlton.sml index 0c6f96ba..c26a9d10 100644 --- a/src/main.mlton.sml +++ b/src/main.mlton.sml @@ -32,9 +32,18 @@ val demo = ref (NONE : (string * bool) option) val tutorial = ref false val css = ref false +fun printVersion () = (print (Config.versionString ^ "\n"); + OS.Process.exit OS.Process.success) +fun printNumericVersion () = (print (Config.versionNumber ^ "\n"); + OS.Process.exit OS.Process.success) + fun doArgs args = case args of [] => () + | "-version" :: rest => + printVersion () + | "-numeric-version" :: rest => + printNumericVersion () | "-css" :: rest => (css := true; doArgs rest) @@ -119,7 +128,7 @@ val () = doArgs (CommandLine.arguments ()) val job = case !sources of [file] => file - | _ => raise Fail "Zero or multiple job files specified" + | _ => printVersion () val () = case (!css, !demo, !tutorial) of |