1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-06-07 11:37:13 +00:00
Files
kbtui/cmdHelp.go
Gregory Rudolph dfe0f0b27a Le-what?
2019-10-03 12:10:14 -04:00

31 lines
567 B
Go

// +build !rm_basic_commands allcommands helpcmd
package main
import (
"fmt"
"sort"
)
func init() {
command := Command{
Cmd: []string{"help", "h"},
Description: "Show information about available commands",
Help: "",
Exec: cmdHelp,
}
RegisterCommand(command)
}
func cmdHelp(cmd []string) {
var helpText string
if len(cmd) == 1 {
sort.Strings(baseCommands)
for _, c := range baseCommands {
helpText = fmt.Sprintf("%s%s%s\t\t%s\n", helpText, cmdPrefix, c, commands[c].Description)
}
}
printToView("Chat", helpText)
}