diff --git a/bool.go b/bool.go index 37ce019..85e1c1d 100644 --- a/bool.go +++ b/bool.go @@ -36,7 +36,7 @@ func (b *boolValue) String() string { // --option=true // --o=false // -// Its value is case insenstive and one of true, false, t, f, on, off, t and 0. +// Its value is case insensitive and one of true, false, t, f, on, off, t and 0. func Bool(name rune, helpvalue ...string) *bool { return CommandLine.Bool(name, helpvalue...) } diff --git a/error.go b/error.go index 3de8e86..75eb6fb 100644 --- a/error.go +++ b/error.go @@ -31,11 +31,11 @@ const ( func (e ErrorCode) String() string { switch e { case UnknownOption: - return "unknow option" + return "unknown option" case MissingParameter: return "missing argument" case ExtraParameter: - return "unxpected value" + return "unexpected value" case Invalid: return "error setting value" } @@ -61,7 +61,7 @@ func unknownOption(name interface{}) *Error { } // missingArg returns an Error inidicating option o was not passed -// a required paramter. +// a required parameter. func missingArg(o Option) *Error { return &Error{ ErrorCode: MissingParameter, @@ -71,7 +71,7 @@ func missingArg(o Option) *Error { } // extraArg returns an Error inidicating option o was passed the -// unexpected paramter value. +// unexpected parameter value. func extraArg(o Option, value string) *Error { return &Error{ ErrorCode: ExtraParameter, diff --git a/getopt.go b/getopt.go index 755500b..69006ab 100644 --- a/getopt.go +++ b/getopt.go @@ -162,7 +162,7 @@ // // The difference bentween Foo and FooVar is that you pass a pointer, p, to the // location of the value to FooVar. The default value is simply *p. The -// initial value of *p is the defaut value of the option. +// initial value of *p is the default value of the option. // // Foo is actually a wrapper around FooVar: // @@ -400,7 +400,7 @@ func (s *Set) Parse(args []string) { // Getopt returns nil when all options have been processed (a non-option // argument was encountered, "--" was encountered, or fn returned false). // -// On error getopt returns a refernce to an InvalidOption (which implements +// On error getopt returns a reference to an InvalidOption (which implements // the error interface). func (s *Set) Getopt(args []string, fn func(Option) bool) (err error) { s.State = InProgress diff --git a/list.go b/list.go index b9d4267..96bde5d 100644 --- a/list.go +++ b/list.go @@ -24,7 +24,7 @@ func (s *listValue) String() string { } // List creates an option that returns a slice of strings. The parameters -// passed are converted from a comma seperated value list into a slice. +// passed are converted from a comma separated value list into a slice. // Subsequent occurrences append to the list. func List(name rune, helpvalue ...string) *[]string { return CommandLine.List(name, helpvalue...) @@ -46,7 +46,7 @@ func (s *Set) ListLong(name string, short rune, helpvalue ...string) *[]string { return &p } -// ListVar creats a list option and places the values in p. If p is pointing +// ListVar creates a list option and places the values in p. If p is pointing // to a list of values then those are considered the default values. The first // time name is seen in the options the list will be set to list specified by // the parameter to the option. Subsequent instances of the option will append diff --git a/option.go b/option.go index 17dbe58..1e856c7 100644 --- a/option.go +++ b/option.go @@ -43,7 +43,7 @@ type Option interface { // SetFlag makes the value a flag. Flags are boolean values and // normally do not taken a value. They are set to true when seen. // If a value is passed in the long form then it must be on, case - // insenstive, one of "true", "false", "t", "f", "on", "off", "1", "0". + // insensitive, one of "true", "false", "t", "f", "on", "off", "1", "0". // SetFlag returns the Option SetFlag() Option diff --git a/set.go b/set.go index 64d9ecf..3c78c36 100644 --- a/set.go +++ b/set.go @@ -27,7 +27,7 @@ const ( type Set struct { State // State of getopt - // args are the parameters remaining after parsing the optoins. + // args are the parameters remaining after parsing the options. args []string // program is the name of the program for usage and error messages. diff --git a/v2/error.go b/v2/error.go index 6f668a3..5177903 100644 --- a/v2/error.go +++ b/v2/error.go @@ -31,11 +31,11 @@ const ( func (e ErrorCode) String() string { switch e { case UnknownOption: - return "unknow option" + return "unknown option" case MissingParameter: return "missing argument" case ExtraParameter: - return "unxpected value" + return "unexpected value" case Invalid: return "error setting value" } @@ -61,7 +61,7 @@ func unknownOption(name interface{}) *Error { } // missingArg returns an Error inidicating option o was not passed -// a required paramter. +// a required parameter. func missingArg(o Option) *Error { return &Error{ ErrorCode: MissingParameter, @@ -71,7 +71,7 @@ func missingArg(o Option) *Error { } // extraArg returns an Error inidicating option o was passed the -// unexpected paramter value. +// unexpected parameter value. func extraArg(o Option, value string) *Error { return &Error{ ErrorCode: ExtraParameter, diff --git a/v2/getopt.go b/v2/getopt.go index e5c52bf..a2876ed 100644 --- a/v2/getopt.go +++ b/v2/getopt.go @@ -175,7 +175,7 @@ // getopt.Flag(&a, 'b', "use method B").SetGroup("method") // // A set can have multiple mutually exclusive groups. Mutually exclusive groups -// are identified with their group name in {}'s appeneded to their help message: +// are identified with their group name in {}'s appended to their help message: // // -a use method A {method} // -b use method B {method} diff --git a/v2/set.go b/v2/set.go index 9f73ede..b151871 100644 --- a/v2/set.go +++ b/v2/set.go @@ -29,7 +29,7 @@ type Set struct { stateMu sync.Mutex state State - // args are the parameters remaining after parsing the optoins. + // args are the parameters remaining after parsing the options. args []string // program is the name of the program for usage and error messages.