diff --git a/main.go b/main.go index ff8216f67..a23344a14 100644 --- a/main.go +++ b/main.go @@ -120,48 +120,6 @@ func RunCustom(args []string) int { return exitCode } -// helpFunc is a custom help function. At the moment it is essentially a copy of -// the cli.BasicHelpFunc that includes flags demonstrating how to use the -// autocomplete flags. -func helpFunc(commands map[string]cli.CommandFactory) string { - var buf bytes.Buffer - buf.WriteString("Usage: nomad [-version] [-help] [-autocomplete-(un)install] []\n\n") - buf.WriteString("Available commands are:\n") - - // Get the list of keys so we can sort them, and also get the maximum - // key length so they can be aligned properly. - keys := make([]string, 0, len(commands)) - maxKeyLen := 0 - for key := range commands { - if len(key) > maxKeyLen { - maxKeyLen = len(key) - } - - keys = append(keys, key) - } - sort.Strings(keys) - - for _, key := range keys { - commandFunc, ok := commands[key] - if !ok { - // This should never happen since we JUST built the list of - // keys. - panic("command not found: " + key) - } - - command, err := commandFunc() - if err != nil { - fmt.Fprintf(os.Stderr, "[ERR] cli: Command '%s' failed to load: %s", key, err) - continue - } - - key = fmt.Sprintf("%s%s", key, strings.Repeat(" ", maxKeyLen-len(key))) - buf.WriteString(fmt.Sprintf(" %s %s\n", key, command.Synopsis())) - } - - return buf.String() -} - func groupedHelpFunc(f cli.HelpFunc) cli.HelpFunc { return func(commands map[string]cli.CommandFactory) string { var b bytes.Buffer