Remove a bunch of duplicate recover code.

This commit is contained in:
Alec Thomas
2018-05-26 15:32:45 -04:00
parent 0bb304449c
commit d20b44baf4
6 changed files with 58 additions and 68 deletions
+6 -2
View File
@@ -18,8 +18,12 @@ usage: {{.Name}}
var defaultHelpTemplate = template.Must(template.New("help").Parse(defaultHelp))
// WriteHelp to w. If w is nil, the default stdout writer will be used.
func (k *Kong) WriteHelp(w io.Writer) error {
// WriteHelp to w.
//
// If w is nil, the default stdout writer will be used.
//
// If args are provided, help will be written in the context o
func (k *Kong) WriteHelp(w io.Writer, args ...interface{}) error {
if w == nil {
w = k.stdout
}