Skip to content

Commit

Permalink
Change Defaults options order
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Dec 4, 2024
1 parent 54f6f36 commit 3af01c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func Example() {
// -i, --ints int a slice of ints
// -d, --date date formatted date
// -v, --verbose enable verbose
// -h, --help show help, then exit
// -v, --version show version, then exit
// -h, --help show help, then exit
//
// See: https://github.com/xo/ox for more information.
}
Expand Down
6 changes: 3 additions & 3 deletions opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ func Exec[F ExecType](f F) CommandOption {
}
}

// Defaults is a [Command] option to add [Help], [Comp], and [Version] to the
// command.
// Defaults is a [Command] option to add [Version], [Help], and [Comp] options
// to the command.
func Defaults(opts ...Option) CommandOption {
options := []Option{Help(opts...), Comp(), Version()}
options := []Option{Version(), Help(opts...), Comp()}
return option{
name: "Defaults",
cmd: func(cmd *Command) error {
Expand Down

0 comments on commit 3af01c2

Please sign in to comment.