console-program-0.3.2.0: Examples/Simple.hs
module Simple where
import System.Console.Command (Commands,Tree(Node),Command(..),io)
import System.Console.Program (single)
myCommands :: Commands IO
myCommands = Node
(Command "say" "" . io $ putStrLn "No command given.")
[
Node
(Command "yes" "" . io $ putStrLn "Yes!")
[]
, Node
(Command "no" "" . io $ putStrLn "No!")
[]
]
main :: IO ()
main = single myCommands