summaryrefslogtreecommitdiff
path: root/cmd/commandfuncs.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/commandfuncs.go')
-rw-r--r--cmd/commandfuncs.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 5fba368..ec9d974 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -28,6 +28,7 @@ import (
"os/exec"
"reflect"
"runtime/debug"
+ "sort"
"strings"
"github.com/caddyserver/caddy/v2"
@@ -470,7 +471,13 @@ usage:
commands:
`
- for _, cmd := range commands {
+ keys := make([]string, 0, len(commands))
+ for k := range commands {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ for _, k := range keys {
+ cmd := commands[k]
short := strings.TrimSuffix(cmd.Short, ".")
s += fmt.Sprintf(" %-15s %s\n", cmd.Name, short)
}