(withAction bool)
| 64 | var ArgsUsageCommandHelp = "[command]" |
| 65 | |
| 66 | func buildHelpCommand(withAction bool) *Command { |
| 67 | cmd := &Command{ |
| 68 | Name: helpName, |
| 69 | Aliases: []string{helpAlias}, |
| 70 | Usage: UsageCommandHelp, |
| 71 | ArgsUsage: ArgsUsageCommandHelp, |
| 72 | HideHelp: true, |
| 73 | builtInHelp: true, |
| 74 | } |
| 75 | |
| 76 | if withAction { |
| 77 | cmd.Action = helpCommandAction |
| 78 | } |
| 79 | |
| 80 | return cmd |
| 81 | } |
| 82 | |
| 83 | func helpCommandAction(ctx context.Context, cmd *Command) error { |
| 84 | args := cmd.Args() |