diff --git a/acmd.go b/acmd.go index cb5f5a0..29599a7 100644 --- a/acmd.go +++ b/acmd.go @@ -51,6 +51,9 @@ type Config struct { // AppDescription is an optional description. default is empty. AppDescription string + // PostDescription of the command. Is shown after a help. + PostDescription string + // Version of the application. Version string @@ -301,6 +304,9 @@ func defaultUsage(w io.Writer) func(cfg Config, cmds []Command) { fmt.Fprintf(w, "Usage:\n\n %s [arguments...]\n\nThe commands are:\n\n", cfg.AppName) printCommands(w, cmds) + if cfg.PostDescription != "" { + fmt.Fprintf(w, "%s\n\n", cfg.PostDescription) + } if cfg.Version != "" { fmt.Fprintf(w, "Version: %s\n\n", cfg.Version) } diff --git a/example_test.go b/example_test.go index a950371..80b5596 100644 --- a/example_test.go +++ b/example_test.go @@ -57,12 +57,13 @@ func ExampleRunner() { } r := acmd.RunnerOf(cmds, acmd.Config{ - AppName: "acmd-example", - AppDescription: "Example of acmd package", - Version: "the best v0.x.y", - Output: testOut, - Args: testArgs, - Usage: nopUsage, + AppName: "acmd-example", + AppDescription: "Example of acmd package", + PostDescription: "Best place to add examples", + Version: "the best v0.x.y", + Output: testOut, + Args: testArgs, + Usage: nopUsage, }) if err := r.Run(); err != nil { @@ -97,11 +98,12 @@ func ExampleHelp() { } r := acmd.RunnerOf(cmds, acmd.Config{ - AppName: "acmd-example", - AppDescription: "Example of acmd package", - Version: "the best v0.x.y", - Output: testOut, - Args: testArgs, + AppName: "acmd-example", + AppDescription: "Example of acmd package", + PostDescription: "Best place to add examples.", + Version: "the best v0.x.y", + Output: testOut, + Args: testArgs, }) if err := r.Run(); err != nil { @@ -122,6 +124,8 @@ func ExampleHelp() { // status prints status of the system // version shows version of the application // + // Best place to add examples. + // // Version: the best v0.x.y }