16 lines
396 B
Haskell
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>"
|