diff options
| author | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-14 15:32:50 +0000 |
|---|---|---|
| committer | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-14 15:32:50 +0000 |
| commit | 29e84fb4a5fc81ebadfc4266b0b753eef44fa558 (patch) | |
| tree | 1d983de15dd34f646dbf5b4581d0afcd5301d74f /Cmd.hs | |
| parent | ac0057a4e0f10b78d3db0bb34c72edd034e15987 (diff) | |
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@31 9f8f72e9-4bf4-416e-b76e-7d4203597157
Diffstat (limited to 'Cmd.hs')
| -rw-r--r-- | Cmd.hs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -7,4 +7,10 @@ data Cmd = Cmd String String (State -> IO ()) instance Show Cmd where show (Cmd a b _) = a ++ " - " ++ b +cmdGet :: String -> [Cmd] -> Maybe Cmd +cmdGet x commands = + let command = [ (Cmd a b c) | (Cmd a b c) <- commands, a == x ] + in if length command == 0 + then Nothing + else Just (head command) |
