From f3fa0bbd1f011c7436f21a18ee08f719a15b02b8 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 8 Aug 2014 08:57:18 +1000 Subject: [PATCH] flag: mention -h in docs Fixes #8314. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/125820043 --- src/pkg/flag/flag.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pkg/flag/flag.go b/src/pkg/flag/flag.go index fa7760550c..de2d91f8b1 100644 --- a/src/pkg/flag/flag.go +++ b/src/pkg/flag/flag.go @@ -73,7 +73,8 @@ import ( "time" ) -// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined. +// ErrHelp is the error returned if the -help or -h flag is invoked +// but no such flag is defined. var ErrHelp = errors.New("flag: help requested") // -- bool Value @@ -788,7 +789,7 @@ func (f *FlagSet) parseOne() (bool, error) { // Parse parses flag definitions from the argument list, which should not // include the command name. Must be called after all flags in the FlagSet // are defined and before flags are accessed by the program. -// The return value will be ErrHelp if -help was set but not defined. +// The return value will be ErrHelp if -help or -h were set but not defined. func (f *FlagSet) Parse(arguments []string) error { f.parsed = true f.args = arguments -- 2.48.1