Skip to content

Commit

Permalink
fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexflint committed May 2, 2019
1 parent a68d600 commit e55b361
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type path struct {

// String gets a string representation of the given path
func (p path) String() string {
if len(p.fields) == 0 {
return "args"
}
return "args." + strings.Join(p.fields, ".")
}

Expand Down Expand Up @@ -330,7 +333,7 @@ func cmdFromStruct(name string, dest path, t reflect.Type) (*command, error) {
}
}
if hasPositional && len(cmd.subcommands) > 0 {
return nil, fmt.Errorf("%T cannot have both subcommands and positional arguments", t)
return nil, fmt.Errorf("%s cannot have both subcommands and positional arguments", dest)
}

return &cmd, nil
Expand Down

0 comments on commit e55b361

Please sign in to comment.