Skip to content

Commit

Permalink
comment:(review) wrote forgotten comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk committed Mar 17, 2024
1 parent 70edf15 commit d3748f3
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions parse-with.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ func (e OptionNameIsDuplicated) GetOpt() string {
return e.Name
}

// UnconfiguredOption
// UnconfiguredOption is the error which indicates that there is no
// configuration about the input option.
type UnconfiguredOption struct{ Name string }

// Error is the method to retrieve the message of this error.
Expand All @@ -81,35 +82,41 @@ func (e UnconfiguredOption) GetOpt() string {
return e.Name
}

// OptionTakesNoArg
type OptionTakesNoArg struct{ Name, StoreKey string }
// OptionNeedsArg is the error which indicates that an option is input with
// no option argument though its option configuration requires option
// argument (.HasArg = true).
type OptionNeedsArg struct{ Name, StoreKey string }

// Error is the method to retrieve the message of this error.
func (e OptionTakesNoArg) Error() string {
return fmt.Sprintf("OptionTakesNoArg{Name:%s,StoreKey:%s}",
func (e OptionNeedsArg) Error() string {
return fmt.Sprintf("OptionNeedsArg{Name:%s,StoreKey:%s}",
e.Name, e.StoreKey)
}

// GetOpt is the method to retrieve the store key that caused this error.
func (e OptionTakesNoArg) GetOpt() string {
func (e OptionNeedsArg) GetOpt() string {
return e.Name
}

// OptionNeedsArg
type OptionNeedsArg struct{ Name, StoreKey string }
// OptionTakesNoArg is the error which indicates that an option is input with
// an option argument though its option configuration does not accept option
// arguments (.HasArg = false).
type OptionTakesNoArg struct{ Name, StoreKey string }

// Error is the method to retrieve the message of this error.
func (e OptionNeedsArg) Error() string {
return fmt.Sprintf("OptionNeedsArg{Name:%s,StoreKey:%s}",
func (e OptionTakesNoArg) Error() string {
return fmt.Sprintf("OptionTakesNoArg{Name:%s,StoreKey:%s}",
e.Name, e.StoreKey)
}

// GetOpt is the method to retrieve the store key that caused this error.
func (e OptionNeedsArg) GetOpt() string {
func (e OptionTakesNoArg) GetOpt() string {
return e.Name
}

// OptionIsNotArray
// OptionIsNotArray is the error which indicates that an option is input with
// an option argument multiple times though its option configuration specifies
// the option is not an array (.IsArray = false).
type OptionIsNotArray struct{ Name, StoreKey string }

// Error is the method to retrieve the message of this error.
Expand Down

0 comments on commit d3748f3

Please sign in to comment.