mirror of
https://github.com/redelmann/scat
synced 2025-01-25 05:24:20 +01:00
Added missing documentation.
This commit is contained in:
parent
6608dce71e
commit
09fe0caf48
@ -43,6 +43,7 @@ scat = do
|
|||||||
printVerbose "Generated password:\n"
|
printVerbose "Generated password:\n"
|
||||||
liftIO $ putStrLn $ evalBuilder s $ scatter k pw
|
liftIO $ putStrLn $ evalBuilder s $ scatter k pw
|
||||||
|
|
||||||
|
-- | Prints, if the verbosity level allows it.
|
||||||
printVerbose :: String -> Scat ()
|
printVerbose :: String -> Scat ()
|
||||||
printVerbose str = do
|
printVerbose str = do
|
||||||
v <- fmap verbose ask
|
v <- fmap verbose ask
|
||||||
@ -77,6 +78,7 @@ getPassword = do
|
|||||||
printVerbose "Passwords do not match, please retry.\n"
|
printVerbose "Passwords do not match, please retry.\n"
|
||||||
getPassConfirm
|
getPassConfirm
|
||||||
|
|
||||||
|
-- | Ask a password on the command line, with the specified prompt.
|
||||||
askPassword :: String -> Scat C.ByteString
|
askPassword :: String -> Scat C.ByteString
|
||||||
askPassword str = do
|
askPassword str = do
|
||||||
printVerbose str
|
printVerbose str
|
||||||
|
@ -33,6 +33,8 @@ data Options = Options
|
|||||||
-- ^ Indicates if the password must be confirmed. Activates verbosity.
|
-- ^ Indicates if the password must be confirmed. Activates verbosity.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{- | Verbosity. If false, do not print anything but the generated password.
|
||||||
|
True when @--verbose@ or @--confirmation@ are specified. -}
|
||||||
verbose :: Options -> Bool
|
verbose :: Options -> Bool
|
||||||
verbose opts = verbose_ opts || confirm opts
|
verbose opts = verbose_ opts || confirm opts
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user