(env *execenv.Env)
| 13 | } |
| 14 | |
| 15 | func newCommandsCommand(env *execenv.Env) *cobra.Command { |
| 16 | options := commandOptions{} |
| 17 | |
| 18 | cmd := &cobra.Command{ |
| 19 | Use: "commands", |
| 20 | Short: "Display available commands.", |
| 21 | RunE: func(cmd *cobra.Command, args []string) error { |
| 22 | return runCommands(env, options) |
| 23 | }, |
| 24 | } |
| 25 | |
| 26 | flags := cmd.Flags() |
| 27 | flags.SortFlags = false |
| 28 | |
| 29 | flags.BoolVarP(&options.desc, "pretty", "p", false, |
| 30 | "Output the command description as well as Markdown compatible comment", |
| 31 | ) |
| 32 | |
| 33 | return cmd |
| 34 | } |
| 35 | |
| 36 | func runCommands(env *execenv.Env, opts commandOptions) error { |
| 37 | first := true |
no test coverage detected