Skip to content

Commit

Permalink
Expand documentation Option
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Nov 24, 2024
1 parent a2bbec0 commit c257018
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,25 @@ func Relative(dir string) Option {
}
*/

// Option is a option.
// Option is the interface for options that can be passed when creating a
// [RunContext], [Command], or [Flag].
//
// The [Option] type is aliased as [RunOption], [CommandOption],
// [CommandFlagOption], and [FlagOption] and provided for ease-of-use,
// readibility, and categorization within documentation.
//
// A [RunOption] can be applied to a [RunContext] and passed to [Run].
//
// A [CommandOption] can be applied to a [Command] and passed to [NewCommand].
//
// A [CommandFlagOption] can be applied to either a [Command] or [Flag], and
// can be passed to [NewCommand] and [NewFlag].
//
// A [FlagOption] can be applied to a [Flag] and passed to [NewFlag].
//
// Additionally, a [OnErr] can be used as a [CommandOption] or in calls to
// [NewCommand], and a [Type] can be used as a [FlagOption] in calls to
// [NewFlag].
type Option interface {
apply(any) error
}
Expand Down
1 change: 1 addition & 0 deletions uuid/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func TestUUID(t *testing.T) {
func uuidTests() []string {
return []string{
"",
"00000000-0000-0000-0000-000000000000",
"f47ac10b-58cc-0372-8567-0e02b2c3d479",
"f47ac10b-58cc-1372-8567-0e02b2c3d479",
"f47ac10b-58cc-2372-8567-0e02b2c3d479",
Expand Down

0 comments on commit c257018

Please sign in to comment.