Skip to content

Commit

Permalink
Change the type aliases for true new types (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
FollowTheProcess authored Sep 25, 2024
1 parent 64cf2f0 commit 2782dc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/FollowTheProcess/cli/internal/table"
)

// Builder is a function that constructs and returns a [Command], it makes constructing
// complex command trees easier as they can be passed directly to the [SubCommands] option.
type Builder func() (*Command, error)

// New builds and returns a new [Command].
//
// The command can be customised by passing in a number of options enabling you to
Expand Down
8 changes: 2 additions & 6 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ const NoShortHand = flag.NoShortHand
//
// It's worth noting that the complete set of supported types is wider than this constraint appears
// as e.g. a [time.Duration] is actually just an int64 underneath, likewise a [net.IP] is actually just []byte.
type Flaggable = flag.Flaggable
type Flaggable flag.Flaggable

// FlagCount is a type used for a flag who's job is to increment a counter, e.g. a "verbosity"
// flag may be passed "-vvv" which should increase the verbosity level to 3.
type FlagCount = flag.Count

// Builder is a function that constructs and returns a [Command], it makes constructing
// complex command trees easier as they can be passed directly to [SubCommands].
type Builder func() (*Command, error)
type FlagCount flag.Count

// Option is a functional option for configuring a [Command].
type Option interface {
Expand Down

0 comments on commit 2782dc3

Please sign in to comment.