From 9c81d374b196ab3f55195263f868f78bd0a10abf Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Wed, 25 Jan 2017 21:30:22 +0100 Subject: [PATCH] heal: Show help when alias is not specified (#1985) --- cmd/admin-heal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/admin-heal.go b/cmd/admin-heal.go index 884d4b42..4a7bc983 100644 --- a/cmd/admin-heal.go +++ b/cmd/admin-heal.go @@ -19,6 +19,7 @@ package cmd import ( "encoding/json" "fmt" + "os" "path/filepath" "github.com/fatih/color" @@ -59,6 +60,7 @@ USAGE: FLAGS: {{range .Flags}}{{.}} {{end}} + COMMANDS: {{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}} {{end}} @@ -99,10 +101,12 @@ func (u healObjectMessage) JSON() string { // checkAdminHealSyntax - validate all the passed arguments func checkAdminHealSyntax(ctx *cli.Context) { if len(ctx.Args()) != 1 { - cli.ShowCommandHelpAndExit(ctx, "heal", 1) // last argument is exit code + cli.ShowSubcommandHelp(ctx) + os.Exit(1) } } +// mainAdminHeal - the entry function of heal command func mainAdminHeal(ctx *cli.Context) error { // Check for command syntax