Browse Source

services: Explicitly show when commands have been disabled in the HELP output

tags/v0.12.0
Daniel Oaks 6 years ago
parent
commit
f142bf065d
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      irc/services.go

+ 6
- 0
irc/services.go View File

@@ -134,18 +134,24 @@ func serviceHelpHandler(service *ircService, server *Server, client *Client, par
134 134
 	if params == "" {
135 135
 		// show general help
136 136
 		var shownHelpLines sort.StringSlice
137
+		var disabledCommands bool
137 138
 		for _, commandInfo := range service.Commands {
138 139
 			// skip commands user can't access
139 140
 			if 0 < len(commandInfo.capabs) && !client.HasRoleCapabs(commandInfo.capabs...) {
140 141
 				continue
141 142
 			}
142 143
 			if commandInfo.enabled != nil && !commandInfo.enabled(server) {
144
+				disabledCommands = true
143 145
 				continue
144 146
 			}
145 147
 
146 148
 			shownHelpLines = append(shownHelpLines, "    "+client.t(commandInfo.helpShort))
147 149
 		}
148 150
 
151
+		if disabledCommands {
152
+			shownHelpLines = append(shownHelpLines, "    "+client.t("... and other commands which have been disabled"))
153
+		}
154
+
149 155
 		// sort help lines
150 156
 		sort.Sort(shownHelpLines)
151 157
 

Loading…
Cancel
Save