Documentation
¶
Index ¶
- func Choose(prompt string, options []string, multiple bool) (string, error)
- func Confirm(prompt string) (string, error)
- func Edit(prompt, placeholder, value string) (string, error)
- func Help()
- func PickFile(prompt string, path string) (string, error)
- func Write(prompt, placeholder, value string) (string, error)
- type Gum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gum ¶
type Gum struct {
// Choose provides an interface to choose one option from a given list of
// options. The options can be provided as (new-line separated) stdin or a
// list of arguments.
// Let's pick from a list of gum flavors:
//
// $ gum choose "Strawberry" "Banana" "Cherry"
//
Choose choose.Options `cmd:"" help:"Choose an option from a list of choices"`
// Confirm provides an interface to ask a user to confirm an action.
// The user is provided with an interface to choose an affirmative or
// negative answer, which is then reflected in the exit code for use in
// scripting.
//
// If the user selects the affirmative answer, the program exits with 0.
// If the user selects the negative answer, the program exits with 1.
Confirm confirm.Options `cmd:"" help:"Ask a user to confirm an action"`
// File provides an interface to pick a file from a folder (tree).
// The user is provided a file manager-like interface to navigate, to
// select a file.
//
// Let's pick a file from the current directory:
//
// $ gum file
// $ gum file .
//
// Let's pick a file from the home directory:
//
// $ gum file $HOME
File file.Options `cmd:"" help:"Pick a file from a folder"`
// Write provides a shell script interface for the text area bubble.
// https://github.com/charmbracelet/bubbles/tree/master/textarea
//
// It can be used to ask the user to write some long form of text
// (multi-line) input. The text the user entered will be sent to stdout.
//
// $ gum write > output.text
//
Write write.Options `cmd:"" help:"Prompt for long-form text"`
Edit edit.Options `cmd:"" help:"Prompt for long-form text"`
}
Gum is the command-line interface for Gum.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package choose provides an interface to choose one option from a given list of options.
|
Package choose provides an interface to choose one option from a given list of options. |
|
Package confirm provides an interface to ask a user to confirm an action.
|
Package confirm provides an interface to ask a user to confirm an action. |
|
Package file provides an interface to pick a file from a folder (tree).
|
Package file provides an interface to pick a file from a folder (tree). |
|
util
|
|
|
tty
Package tty provides tty-aware printing.
|
Package tty provides tty-aware printing. |
|
Package write provides a shell script interface for the text area bubble.
|
Package write provides a shell script interface for the text area bubble. |
Click to show internal directories.
Click to hide internal directories.