1 | module.exports = class Controller
|
2 | @commands: {}
|
3 | @helps = {}
|
4 |
|
5 | @set: (options)->
|
6 | cmds = options['commands']
|
7 | cmds['help'] = 'help'
|
8 | for i of cmds
|
9 | if Array.isArray(cmds[i])
|
10 | @commands[i] = cmds[i][0]
|
11 | @helps[i] = cmds[i][1]
|
12 | else
|
13 | @commands[i] = cmds[i]
|
14 |
|
15 | help: ()->
|
16 | for i of @constructor.helps
|
17 | console.log "Command: #{i}\n=============================="
|
18 | console.log @constructor.helps[i]
|
19 | console.log " "
|