Improve error handling

Checks the file extension before attempting to read the file.
Also allow empty argument list.
This commit is contained in:
2014-10-01 23:08:58 +02:00
parent 9272ff32d4
commit 860e7af61d
2 changed files with 25 additions and 14 deletions

View File

@@ -4,5 +4,7 @@ import System.Environment
main :: IO ()
main = do
[a] <- getArgs
startGUI a
a <- getArgs
case null a of
False -> startGUI (head a)
True -> startGUI ""