2016-08-06 11:29:27 +00:00
|
|
|
module Main where
|
|
|
|
|
2016-08-07 14:26:54 +00:00
|
|
|
import Control.Monad (when)
|
2016-08-06 15:52:49 +00:00
|
|
|
import Gui (runEditor)
|
|
|
|
import System.Environment (getArgs)
|
2016-08-06 11:29:27 +00:00
|
|
|
|
|
|
|
main = do
|
|
|
|
args <- getArgs
|
2016-08-07 14:26:54 +00:00
|
|
|
when (null args) $ error (msgWithUsage "Please specify a file")
|
2016-08-06 11:29:27 +00:00
|
|
|
runEditor $ head args
|
2016-08-07 14:26:54 +00:00
|
|
|
|
|
|
|
msgWithUsage :: String -> String
|
|
|
|
msgWithUsage = \x -> x ++ "\n" ++ usage
|
|
|
|
|
|
|
|
usage :: String
|
|
|
|
usage = "Usage: hedit <file>"
|