terncli: make help message more legible

This commit is contained in:
Isabella Bosia
2025-12-16 13:38:35 +00:00
parent d6db8c6cc8
commit b70fb8073d

View File

@@ -58,8 +58,12 @@ func usage() {
commandsStrs = append(commandsStrs, c)
}
slices.Sort(commandsStrs)
fmt.Fprintf(os.Stderr, "Usage: %v %v\n\n", os.Args[0], strings.Join(commandsStrs, "|"))
fmt.Fprintf(os.Stderr, "Global options:\n\n")
fmt.Fprintf(os.Stderr, "Usage: %v <command> [options]\n\n", os.Args[0])
fmt.Fprintf(os.Stderr, "Commands:\n")
for _, cmd := range commandsStrs {
fmt.Fprintf(os.Stderr, " %s\n", cmd)
}
fmt.Fprintf(os.Stderr, "\nGlobal options:\n")
flag.PrintDefaults()
}