* feat(spin): Add support for `--show-error` for the spinner.
This makes it so that if the `--show-error` flag is provided then the
full output of the command will be printed if the command fails. This
kind of works in conjuncture with `--show-output` in that if the command
succeeds only STDOUT is pushed. If the command fails both `STDOUT` and
`STDERR` are pushed.
This builds off of https://github.com/charmbracelet/gum/pull/371Resolves#55
* chore: Fix formatting
---------
Co-authored-by: Elliot Courant <me@elliotcourant.dev>
* 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
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.
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
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.