diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-08-02 13:33:38 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-08-02 13:33:38 -0400 |
commit | d727966ce805067e227fa96262005056fdfac448 (patch) | |
tree | bddb0a36e8b85f6742e31a47db77399b24b3fd36 /src/main.mlton.sml | |
parent | 729998f64e891856f43f758551be0aaa26ac89b4 (diff) |
Tracking and printing of version numbers (based on a patch by Austin Seipp)
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 |