Hide Style Flags consistently (#457)

* refactor: hide style flags on error to not clutter usage

* docs(style): add comment regarding dynamically hiding flags
This commit is contained in:
Maas Lalani 2023-11-28 14:17:57 -05:00 committed by GitHub
commit 01a66511a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 57 additions and 102 deletions

View file

@ -8,10 +8,8 @@ import (
"github.com/charmbracelet/gum/internal/exit"
"github.com/alecthomas/kong"
"github.com/charmbracelet/bubbles/filepicker"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/gum/style"
)
// Run is the interface to picking a file.
@ -72,9 +70,3 @@ func (o Options) Run() error {
return nil
}
// BeforeReset hook. Used to unclutter style flags.
func (o Options) BeforeReset(ctx *kong.Context) error {
style.HideFlags(ctx)
return nil
}