-
Notifications
You must be signed in to change notification settings - Fork 29
/
Commands.hs
74 lines (61 loc) · 2.21 KB
/
Commands.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{-
Copyright (C) 2006-2008 John Goerzen <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-}
{- |
Module : Commands
Copyright : Copyright (C) 2006-2010 John Goerzen
License : GNU GPL, version 2 or above
Maintainer : John Goerzen <[email protected]>
Stability : provisional
Portability: portable
Written by John Goerzen, jgoerzen\@complete.org
-}
module Commands where
import Text.Printf
import Utils
import Types
import qualified Commands.FollowBlock
import qualified Commands.Ls
import qualified Commands.Setup
import qualified Commands.Update
--allCommands :: [(String, Command)]
allCommands =
[Commands.Update.dmsend,
Commands.FollowBlock.block,
Commands.FollowBlock.follow,
Commands.Ls.lsarchive,
lscommands,
Commands.Ls.lsdm,
Commands.Ls.lsdmarchive,
Commands.Ls.lsblocking,
Commands.Ls.lsfollowers,
Commands.Ls.lsfollowing,
Commands.Ls.lsrecent,
Commands.Ls.lsreplies,
Commands.Ls.lsrtreplies,
Commands.Ls.status,
Commands.Setup.setup,
Commands.FollowBlock.unblock,
Commands.FollowBlock.unfollow,
Commands.Update.update
]
lscommands =
simpleCmd "lscommands" "Display a list of all available commands" ""
[] lscommands_worker
lscommands_worker _ _ _ =
do putStrLn "All available commands:"
printf "%-20s %s\n" "Name" "Description"
putStrLn "-------------------- -------------------------------------------------------"
mapM_ (\(_, x) -> printf "%-20s %s\n" (cmdname x) (cmddescrip x))
allCommands