Skip to content

Commit

Permalink
Make parseArgs total by handling the case where there is an unrecogni…
Browse files Browse the repository at this point in the history
…zed argument
  • Loading branch information
ayberkt committed Jul 10, 2017
1 parent 5caa859 commit 6a677a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/flags.sml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ structure Flags : FLAGS = struct
fun parseArgs [] = ()
| parseArgs ("--latex"::rest) =
(flgShouldGenLaTeX := true; parseArgs rest)
| parseArgs ("--steps"::rest) = parseArgs rest
| parseArgs ("--out"::file::rest) =
(flgOutFile := SOME file; parseArgs rest)
| parseArgs (arg::_) =
(print ("Unrecognized argument: " ^ arg ^ "\n");
OS.Process.exit OS.Process.failure)
end

0 comments on commit 6a677a7

Please sign in to comment.