1
0
mirror of https://github.com/redelmann/scat synced 2025-01-10 06:34:20 +01:00

Added option to disable ANSI output formating.

This commit is contained in:
Romain Edelmann 2013-08-14 17:11:13 +02:00
parent f6865d3277
commit 662caea421

View File

@ -13,6 +13,7 @@ module Scat.Options
, schema , schema
, verbose , verbose
, confirm , confirm
, ansi
-- * Execution -- * Execution
, getOptions , getOptions
@ -37,6 +38,8 @@ data Options = Options
-- ^ Verbosity. If false, do not print anything but the generated password. -- ^ Verbosity. If false, do not print anything but the generated password.
, confirm :: Bool , confirm :: Bool
-- ^ Indicates if the password must be confirmed. -- ^ Indicates if the password must be confirmed.
, ansi :: Bool
-- ^ Indicates if ANSI escape sequences can be used.
} }
-- | Parses the arguments from the command line. -- | Parses the arguments from the command line.
@ -45,7 +48,9 @@ getOptions = execParser opts
where where
opts = info (helper <*> options) opts = info (helper <*> options)
(fullDesc (fullDesc
<> progDesc "Safely generate passwords derived from a unique password and code." <> progDesc (unwords
[ "Safely generate passwords derived "
, "from a unique password and code." ])
<> header "scat - a password scatterer") <> header "scat - a password scatterer")
-- | Option parser. -- | Option parser.
@ -83,3 +88,6 @@ options = Options
(short 'c' (short 'c'
<> long "confirmation" <> long "confirmation"
<> help "Asks for password confirmation") <> help "Asks for password confirmation")
<*> flag True False
(long "noansi"
<> help "Do not use ANSI escape sequences to format output")