gum/spin/options.go
Greg Kroah-Hartman 6677920319 feat: add alignment for spinner title
Sometimes it is nice to spin to the right side of the title, not the
left, so add a --align option to pick the left or right side.  The
default remains "left".

New option is:
	--align="left|right"
and the environment variable GUM_SPIN_ALIGN can also be used.
2022-10-02 14:42:19 -04:00

16 lines
956 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 output of command" 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"`
}