cli: Make sure to add --help flag for subcommands. (#3773)

--help is now back and prints properly with command
help template.
This commit is contained in:
Harshavardhana
2017-02-19 20:46:06 -08:00
committed by GitHub
parent 7ea1de8245
commit 9eb8e375c5
7 changed files with 49 additions and 20 deletions

View File

@@ -104,6 +104,10 @@ func registerApp() *cli.App {
registerCommand(updateCmd)
// Set up app.
cli.HelpFlag = cli.BoolFlag{
Name: "help, h",
Usage: "Show help.",
}
app := cli.NewApp()
app.Name = "Minio"
app.Author = "Minio.io"
@@ -111,6 +115,8 @@ func registerApp() *cli.App {
app.Usage = "Cloud Storage Server."
app.Description = `Minio is an Amazon S3 compatible object storage server. Use it to store photos, videos, VMs, containers, log files, or any blob of data as objects.`
app.Flags = globalFlags
app.HideVersion = true // Hide `--version` flag, we already have `minio version`.
app.HideHelpCommand = true // Hide `help, h` command, we already have `minio --help`.
app.Commands = commands
app.CustomAppHelpTemplate = minioHelpTemplate
app.CommandNotFound = func(ctx *cli.Context, command string) {