mirror of
https://github.com/charmbracelet/gum
synced 2024-06-02 05:42:18 +02:00
f048bd8d87
* Added live output buffer and option flag * Update Spin on README.md * Returned output formatting to previous version. * Separated the showOutput and liveOutput flags. Both flags can now be used at once. * Removed liveOutout flag showOutput flag is now realtime * (spin) Consolodated stderr and stdout * (spin) Consolodated stdout and stderr * (spin) If being piped, writes to stdout * Added error check and did some housekeeping * No longer outputs to tea.View if piped * Cleaned up the combining of stderr and stdout * Fixed spinner alignment. Updated Readme
16 lines
981 B
Go
16 lines
981 B
Go
package spin
|
|
|
|
import "github.com/charmbracelet/gum/style"
|
|
|
|
// Options is the customization options for the spin command.
|
|
type Options struct {
|
|
Command []string `arg:"" help:"Command to run"`
|
|
|
|
ShowOutput bool `help:"Show or pipe output of command during execution" default:"false" env:"GUM_SPIN_SHOW_OUTPUT"`
|
|
Spinner string `help:"Spinner type" short:"s" type:"spinner" enum:"line,dot,minidot,jump,pulse,points,globe,moon,monkey,meter,hamburger" default:"dot" env:"GUM_SPIN_SPINNER"`
|
|
SpinnerStyle style.Styles `embed:"" prefix:"spinner." set:"defaultForeground=212" envprefix:"GUM_SPIN_SPINNER_"`
|
|
Title string `help:"Text to display to user while spinning" default:"Loading..." env:"GUM_SPIN_TITLE"`
|
|
TitleStyle style.Styles `embed:"" prefix:"title." envprefix:"GUM_SPIN_TITLE_"`
|
|
Align string `help:"Alignment of spinner with regard to the title" short:"a" type:"align" enum:"left,right" default:"left" env:"GUM_SPIN_ALIGN"`
|
|
}
|