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.
* feat: pass stderr
Pass stderr from the command run by gum spin analog to how stdout is passed.
#63
* Apply suggestions from code review
* Update spin/spin.go
* fix(spin): Add stderr to output
When `--show-output` is passed we should display all the output of the
command and allow scripters to control `stderr` and `stdout` how they
want.
For example, if a user wants only `stdout` they can redirect stderr to
`/dev/null`:
```
gum spin --show-output -- <action> 2> /dev/null
```
Co-authored-by: Maas Lalani <maas@lalani.dev>
Spin provides a shell script interface for the spinner bubble. 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.