request master password
This commit is contained in:
parent
53b5c6d106
commit
1e71698388
23
app/Main.hs
23
app/Main.hs
|
@ -19,9 +19,30 @@ License along with this program. If not, see
|
|||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
-}
|
||||
|
||||
module Main where
|
||||
|
||||
import System.Console.HCL
|
||||
( Request (..)
|
||||
, execReq
|
||||
, prompt
|
||||
, reqFail
|
||||
, reqIO
|
||||
, reqPassword
|
||||
, required
|
||||
)
|
||||
|
||||
main :: IO ()
|
||||
main = undefined
|
||||
main = execReq getMasterPass
|
||||
|
||||
getMasterPass :: Request String
|
||||
getMasterPass = do
|
||||
p1 <- required $ prompt "master password: " reqPassword
|
||||
p2 <- required $ prompt "confirm master password: " reqPassword
|
||||
if p1 /= p2
|
||||
then do
|
||||
reqIO $ putStrLn "passwords do not match"
|
||||
reqFail
|
||||
else return p1
|
||||
|
||||
--jl
|
||||
|
|
|
@ -26,7 +26,7 @@ library:
|
|||
source-dirs: src
|
||||
|
||||
executables:
|
||||
passman-exe:
|
||||
passman:
|
||||
main: Main.hs
|
||||
source-dirs: app
|
||||
ghc-options:
|
||||
|
@ -35,6 +35,7 @@ executables:
|
|||
- -with-rtsopts=-N
|
||||
dependencies:
|
||||
- passman
|
||||
- HCL >= 1.7.1 && < 2
|
||||
|
||||
tests:
|
||||
passman-test:
|
||||
|
|
|
@ -37,7 +37,8 @@ packages:
|
|||
# Dependency packages to be pulled from upstream that are not in the resolver
|
||||
# using the same syntax as the packages field.
|
||||
# (e.g., acme-missiles-0.3)
|
||||
# extra-deps: []
|
||||
extra-deps:
|
||||
- HCL-1.7.1@sha256:7bc617fbc9ba4b1f9c10d9b3e195042c1f031629f86d08253eec87660492d646
|
||||
|
||||
# Override default flag values for local packages and extra-deps
|
||||
# flags: {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user