Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down
8 changes: 4 additions & 4 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions getopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
//
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion option.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions v2/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion v2/getopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion v2/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down