Skip to content
Browse files

Add a definition for options.

zoom-cache-gnuplot now accepts options from the list of options (currently empty).
  • Loading branch information...
1 parent a092da2 commit 192c205557892efb22100508558fefb2b2b63edd @alang9 committed Oct 19, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 tools/zoom-cache-gnuplot.hs
View
10 tools/zoom-cache-gnuplot.hs
@@ -43,8 +43,16 @@ parseCustom s =
Custom s1 [s2]
where (s1, s2) = break (=='=') s
+options :: [OptDescr (Options -> Options)]
+options =
+ []
+
parseOpts :: [String] -> IO (Options, [String])
-parseOpts s = return (defaultOptions, s)
+parseOpts argv =
+ case getOpt Permute options argv of
+ (o, n, []) -> return (foldl (flip id) defaultOptions o, n)
+ (_, _, errs) -> ioError (userError (concat errs ++ usageInfo header options))
+ where header = "Usage: zoom-cache-gnuplot ..."
main :: IO ()
main = do

0 comments on commit 192c205

Please sign in to comment.
Something went wrong with that request. Please try again.