mirror of
https://github.com/charmbracelet/gum.git
synced 2024-10-26 07:10:39 +03:00
docs: gum confirm
This commit is contained in:
parent
cb2c6ca2dd
commit
8f7a921e6a
12
README.md
12
README.md
@ -188,6 +188,18 @@ cat foods.txt | gum choose --no-limit
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/choose.gif?cache=1" width="600" alt="Shell running gum choose with numbers and gum flavors" />
|
||||
|
||||
#### Confirm
|
||||
|
||||
Confirm whether to perform an action. Exits with code `0` (affirmative) or `1`
|
||||
(negative) depending on selection.
|
||||
|
||||
```bash
|
||||
gum confirm && rm file.txt || echo "File not removed"
|
||||
```
|
||||
|
||||
<img src="https://stuff.charm.sh/gum/confirm.gif?cache=1" width="600" alt="Shell running gum confirm" />
|
||||
|
||||
|
||||
#### Spin
|
||||
|
||||
Display a spinner while running a script or command. The spinner will
|
||||
|
@ -8,7 +8,7 @@ type Options struct {
|
||||
Negative string `help:"The title of the negative action" default:"No"`
|
||||
Prompt string `arg:"" help:"Prompt to display." default:"Are you sure?"`
|
||||
Vertical bool `help:"Whether to display the options vertically" default:"false"`
|
||||
PromptStyle style.Styles `embed:"" prefix:"prompt." help:"The style of the prompt"`
|
||||
UnselectedStyle style.Styles `embed:"" prefix:"unselected." help:"The style of the unselected action" set:"defaultBackground=0" set:"defaultPadding=0 3" set:"defaultMargin=1 1"`
|
||||
SelectedStyle style.Styles `embed:"" prefix:"selected." help:"The style of the selected action" set:"defaultBackground=8" set:"defaultForeground=212" set:"defaultPadding=0 3" set:"defaultMargin=1 1"`
|
||||
PromptStyle style.Styles `embed:"" prefix:"prompt." help:"The style of the prompt" set:"defaultMargin=1 0 0 0"`
|
||||
UnselectedStyle style.Styles `embed:"" prefix:"unselected." help:"The style of the unselected action" set:"defaultBackground=237" set:"defaultPadding=0 3" set:"defaultMargin=1 1"`
|
||||
SelectedStyle style.Styles `embed:"" prefix:"selected." help:"The style of the selected action" set:"defaultBackground=240" set:"defaultForeground=212" set:"defaultPadding=0 3" set:"defaultMargin=1 1"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user