aura-3.2.8: A secure package manager for Arch Linux and the AUR.
Copyright(c) Colin Woodbury 2012 - 2021
LicenseGPL3
MaintainerColin Woodbury <colin@fosskers.ca>
Safe HaskellNone
LanguageHaskell2010

Aura.IO

Description

User-facing input and output utilities.

Synopsis

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.

putText :: MonadIO m => Text -> m () Source #

putTextLn :: MonadIO m => Text -> m () Source #

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.

isAffirmative :: Language -> Text -> Bool Source #

An empty response emplies "yes".

optionalPrompt :: Settings -> (Language -> Doc AnsiStyle) -> IO Bool Source #

Doesn't prompt when `--noconfirm` is used.

getSelection :: Foldable f => (a -> Text) -> f a -> IO a Source #

Given a number of selections, allows the user to choose one.