Copyright | (c) Colin Woodbury 2012 - 2021 |
---|---|
License | GPL3 |
Maintainer | Colin Woodbury <colin@fosskers.ca> |
Safe Haskell | None |
Language | Haskell2010 |
User-facing input and output utilities.
Synopsis
- putStrLnA :: MonadIO m => Settings -> Doc AnsiStyle -> m ()
- putStrA :: MonadIO m => Settings -> Doc AnsiStyle -> m ()
- colourCheck :: Settings -> Doc ann -> Doc ann
- putText :: MonadIO m => Text -> m ()
- putTextLn :: MonadIO m => Text -> m ()
- entrify :: Settings -> [Text] -> [Doc AnsiStyle] -> Doc AnsiStyle
- padding :: Settings -> [Text] -> [Text]
- yesNoPrompt :: Settings -> Doc AnsiStyle -> IO Bool
- isAffirmative :: Language -> Text -> Bool
- optionalPrompt :: Settings -> (Language -> Doc AnsiStyle) -> IO Bool
- withOkay :: Settings -> (Language -> Doc AnsiStyle) -> (Language -> Doc AnsiStyle) -> RIO e a -> RIO e a
- getSelection :: Foldable f => (a -> Text) -> f a -> IO a
Documentation
putStrLnA :: MonadIO m => Settings -> Doc AnsiStyle -> m () Source #
Print a Doc
with Aura flair after performing a colourCheck
.
putStrA :: MonadIO m => Settings -> Doc AnsiStyle -> m () Source #
Will remove all colour annotations if the user specified --color=never
.
colourCheck :: Settings -> Doc ann -> Doc ann Source #
Strip colours from a Doc
if --color=never
is specified,
or if the output target isn't a terminal.
entrify :: Settings -> [Text] -> [Doc AnsiStyle] -> Doc AnsiStyle Source #
Format two lists into two nice rows a la `-Qi` or `-Si`.
padding :: Settings -> [Text] -> [Text] Source #
Right-pads strings according to the longest string in the group.
optionalPrompt :: Settings -> (Language -> Doc AnsiStyle) -> IO Bool Source #
Doesn't prompt when `--noconfirm` is used.