spin

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package spin provides a shell script interface for the spinner bubble. https://github.com/charmbracelet/bubbles/tree/master/spinner

It is useful for displaying that some task is running in the background while consuming it's output so that it is not shown to the user.

For example, let's do a long running task: $ sleep 5

We can simply prepend a spinner to this task to show it to the user, while performing the task / command in the background.

$ gum spin -t "Taking a nap..." -- sleep 5

The spinner will automatically exit when the task is complete.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Command []string `arg:"" help:"Command to run"`

	Spinner      string       `` /* 134-byte string literal not displayed */
	SpinnerStyle style.Styles `embed:"" prefix:"spinner." set:"defaultForeground=212" set:"name=spinner"`
	Title        string       `help:"Text to display to user while spinning" default:"Loading..."`
	TitleStyle   style.Styles `embed:"" prefix:"title." set:"name=title"`
}

Options is the customization options for the spin command.

func (Options) BeforeReset

func (o Options) BeforeReset(ctx *kong.Context) error

BeforeReset hook. Used to unclutter style flags.

func (Options) Run

func (o Options) Run() error

Run provides a shell script interface for the spinner bubble. https://github.com/charmbracelet/bubbles/spinner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL