cli-extras-0.2.0.0: Miscellaneous utilities for building and working with command line interfaces
Safe HaskellNone
LanguageHaskell2010

Cli.Extras.Spinner

Description

Provides a simple CLI spinner that interoperates cleanly with the rest of the logging output.

Synopsis

Documentation

withSpinner :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> m a -> m a Source #

Run an action with a CLI spinner.

withSpinnerNoTrail :: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) => Text -> m a -> m a Source #

A spinner that leaves no trail after a successful run.

Use if you wish the spinner to be ephemerally visible to the user.

The 'no trail' property automatically carries over to sub-spinners (in that they won't leave a trail either).

withSpinner' Source #

Arguments

:: (MonadIO m, MonadMask m, CliLog m, HasCliConfig e m) 
=> Text 
-> Maybe (a -> Text)

Leave an optional trail with the given message creator

-> m a 
-> m a 

Advanced version that controls the display and content of the trail message.