UNPKG

813 Btext/coffeescriptView Raw
1Configuration = require './configuration'
2_ = require('underscore')._
3
4DisabledCommands = Configuration.Nconf.get('disabledCommands')
5Utils = require './utils'
6
7help = (fallback) ->
8 for key, value of list
9 Utils.fallback_print(fallback) {
10 title: key,
11 comments: value.description
12 }
13
14# All the commands should have a fallback function or null as first argument
15# Due to some Commander weirdness,
16# it's better to use _.isString to check if an argument exists
17#
18# TODO: See if we can make that cleaner
19list = {
20 pulls: require('./pulls'),
21 deploy: require('./deploy'),
22 changelog: require('./changelog'),
23 amazon: require('./amazon'),
24 help: {
25 name: "Help"
26 description: "Display a list of available commands",
27 action: help
28 }
29}
30
31module.exports = _.omit(list, DisabledCommands)