diff --git a/acmd.go b/acmd.go index 6ee2fbd..8f6d6cc 100644 --- a/acmd.go +++ b/acmd.go @@ -168,7 +168,7 @@ var defaultUsage = func(w io.Writer) func(cfg Config, cmds []Command) { fmt.Fprintf(w, "%s\n\n", cfg.AppDescription) } - fmt.Fprintf(w, "Usage:\n\n %s [arguments]\n\nThe commands are:\n\n", cfg.AppName) + fmt.Fprintf(w, "Usage:\n\n %s [arguments...]\n\nThe commands are:\n\n", cfg.AppName) printCommands(w, cmds) if cfg.Version != "" { @@ -182,7 +182,11 @@ func printCommands(w io.Writer, cmds []Command) { minwidth, tabwidth, padding, padchar, flags := 0, 0, 11, byte(' '), uint(0) tw := tabwriter.NewWriter(w, minwidth, tabwidth, padding, padchar, flags) for _, cmd := range cmds { - fmt.Fprintf(tw, " %s\t%s\n", cmd.Name, cmd.Description) + desc := cmd.Description + if desc == "" { + desc = "" + } + fmt.Fprintf(tw, " %s\t%s\n", cmd.Name, desc) } fmt.Fprint(tw, "\n") tw.Flush() diff --git a/example_test.go b/example_test.go index f0eefc7..4b2bbb1 100644 --- a/example_test.go +++ b/example_test.go @@ -70,9 +70,8 @@ func ExampleHelp() { Do: nopFunc, }, { - Name: "boom", - Description: "bombom", - Do: nopFunc, + Name: "boom", + Do: nopFunc, }, } @@ -92,11 +91,11 @@ func ExampleHelp() { // // Usage: // - // acmd-example [arguments] + // acmd-example [arguments...] // // The commands are: // - // boom bombom + // boom // help shows help message // now prints current time // status prints status of the system