hsedit/src/Main.hs
2016-08-07 16:26:54 +02:00

16 lines
396 B
Haskell

module Main where
import Control.Monad (when)
import Gui (runEditor)
import System.Environment (getArgs)
main = do
args <- getArgs
when (null args) $ error (msgWithUsage "Please specify a file")
runEditor $ head args
msgWithUsage :: String -> String
msgWithUsage = \x -> x ++ "\n" ++ usage
usage :: String
usage = "Usage: hedit <file>"