Skip to content

Commit

Permalink
move IsDefaultVisible to DocGenerationFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
Skeeve committed Jun 29, 2024
1 parent b3d3fac commit deb0ef7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ type PersistentFlag interface {
IsPersistent() bool
}

// IsDefaultVisible returns true if the flag is not hidden, otherwise false
func (f *FlagBase[T, C, V]) IsDefaultVisible() bool {
return !f.HideDefault
}

func newFlagSet(name string, flags []Flag) (*flag.FlagSet, error) {
set := flag.NewFlagSet(name, flag.ContinueOnError)

Expand Down
5 changes: 0 additions & 5 deletions flag_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@ func (f *FlagBase[T, C, V]) IsVisible() bool {
return !f.Hidden
}

// IsDefaultVisible returns true if the flag is not hidden, otherwise false
func (f *FlagBase[T, C, V]) IsDefaultVisible() bool {
return !f.HideDefault
}

// GetCategory returns the category of the flag
func (f *FlagBase[T, C, V]) GetCategory() string {
return f.Category
Expand Down

0 comments on commit deb0ef7

Please sign in to comment.