packages feed

multi-cabal-0.1.0.0: src/MultiCabal/Commands.hs

{- |
Module      :  $Header$
Description :  A simple data type representing commands.
Author      :  Nils 'bash0r' Jonsson
Copyright   :  (c) 2015 Nils 'bash0r' Jonsson
License     :  MIT

Maintainer  :  aka.bash0r@gmail.com
Stability   :  unstable
Portability :  non-portable (Portability is untested.)

A simple data type representing commands in the application.
-}
module MultiCabal.Commands
(
) where

import Control.Command
import Control.Router

import MultiCabal.Instruction

import qualified MultiCabal.Commands.Help    as CH
import qualified MultiCabal.Commands.Install as CI
import qualified MultiCabal.Commands.Version as CV


instance Command Instruction where
    execute Install xs = CI.invokeExec xs
    execute Version xs = CV.invokeExec xs
    execute Help    xs = CH.invokeExec xs
 
    help    Install    = CI.invokeHelp
    help    Version    = CV.invokeHelp
    help    Help       = CH.invokeHelp

instance Router Instruction where
    routes Help    "help"    = True
    routes Install "install" = True
    routes Version "version" = True
    routes _       _         = False