packages feed

console-program-0.3.0.0: Examples/Simple.hs

module Simple where


import System.Console.Command (Commands,Tree(Node),Command(..),io)
import System.Program         (single)


myCommands :: Commands
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