Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Switch order of case statement in options parser #69

Merged
merged 1 commit into from

2 participants

@matthewSorensen

Instead of failing with a non-exhaustive pattern error for 3 or more arguments, extopenscad now prints the help message. This doesn't change any functionality, just makes things a bit more helpful.

@colah colah merged commit b5f8d8f into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 12, 2012
  1. @matthewSorensen
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 extopenscad.hs
View
7 extopenscad.hs
@@ -130,9 +130,6 @@ main = do
args' = if head args == "-xml-error" then tail args else args
writeIORef xmlErrorOn (head args == "-xml-error")
case length args' of
- 0 -> putStrLn $
- "syntax: extopenscad inputfile.escad [outputfile.format]\n"
- ++ "eg. extopenscad input.escad out.stl"
1 -> do
f <- openFile (args' !! 0) ReadMode
content <- hGetContents f
@@ -144,4 +141,8 @@ main = do
executeAndExportSpecifiedTargetType
content (args' !! 1) (fileType $ args' !! 1)
hClose f
+ _ -> putStrLn $
+ "syntax: extopenscad inputfile.escad [outputfile.format]\n"
+ ++ "eg. extopenscad input.escad out.stl"
+
Something went wrong with that request. Please try again.