From 662caea42149de1d28eb315d59c5cb52715d9714 Mon Sep 17 00:00:00 2001 From: Romain Edelmann Date: Wed, 14 Aug 2013 17:11:13 +0200 Subject: [PATCH] Added option to disable ANSI output formating. --- src/Scat/Options.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Scat/Options.hs b/src/Scat/Options.hs index 63f1a23..cce4e99 100644 --- a/src/Scat/Options.hs +++ b/src/Scat/Options.hs @@ -13,6 +13,7 @@ module Scat.Options , schema , verbose , confirm + , ansi -- * Execution , getOptions @@ -37,6 +38,8 @@ data Options = Options -- ^ Verbosity. If false, do not print anything but the generated password. , confirm :: Bool -- ^ Indicates if the password must be confirmed. + , ansi :: Bool + -- ^ Indicates if ANSI escape sequences can be used. } -- | Parses the arguments from the command line. @@ -45,7 +48,9 @@ getOptions = execParser opts where opts = info (helper <*> options) (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") -- | Option parser. @@ -83,3 +88,6 @@ options = Options (short 'c' <> long "confirmation" <> help "Asks for password confirmation") + <*> flag True False + (long "noansi" + <> help "Do not use ANSI escape sequences to format output")