| 100 | } |
| 101 | |
| 102 | func (h *Help) printTopLevelHelp() { |
| 103 | fmt.Fprintf(h.cdr.Output, "Usage: %s <flags> <subcommand> <subcommand args>\n\n", h.cdr.Name()) |
| 104 | fmt.Fprintf(h.cdr.Output, `runsc is the gVisor container runtime. |
| 105 | |
| 106 | Functionality is provided by subcommands. For help with a specific subcommand, |
| 107 | use "%s %s <subcommand>". |
| 108 | |
| 109 | `, h.cdr.Name(), h.Name()) |
| 110 | h.cdr.VisitGroups(func(g *subcommands.CommandGroup) { |
| 111 | h.cdr.ExplainGroup(h.cdr.Output, g) |
| 112 | }) |
| 113 | |
| 114 | fmt.Fprintf(h.cdr.Output, "Additional help topics (Use \"%s %s <topic>\" to see help on the topic):\n", h.cdr.Name(), h.Name()) |
| 115 | for _, cmd := range h.commands { |
| 116 | fmt.Fprintf(h.cdr.Output, "\t%-15s %s\n", cmd.Name(), cmd.Synopsis()) |
| 117 | } |
| 118 | fmt.Fprintf(h.cdr.Output, "\nUse \"%s flags\" for a list of top-level flags\n", h.cdr.Name()) |
| 119 | } |
| 120 | |
| 121 | // Register registers a new help command. |
| 122 | func (h *Help) Register(cmd subcommands.Command) { |