summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-04-26 04:28:14 -0400
committerjoe <joe@jerkface.net>2016-04-26 04:28:14 -0400
commit30a948ff8dd9f60e6a860d38c3ec76728f8dcbdb (patch)
tree1324fce853e23a831c80c0d90327699eca6f448f /kiki.hs
parent211a1a7290dba4a2ee5367132e523b4c17f91f92 (diff)
Better error message.
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/kiki.hs b/kiki.hs
index 3f1843f..a662ef5 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -1045,13 +1045,15 @@ sync bExport bImport bSecret cmdarg args_raw = do
1045 -- putStrLn $ "margs = " ++ show (Map.assocs margs) 1045 -- putStrLn $ "margs = " ++ show (Map.assocs margs)
1046 unkeysRef <- newIORef Map.empty 1046 unkeysRef <- newIORef Map.empty
1047 pwRef <- newIORef Nothing 1047 pwRef <- newIORef Nothing
1048 let keypairs0 = parseKeySpecs (fromMaybe [] $ Map.lookup "--pems" margs) 1048 let keypairs0 = parseKeySpecs specs
1049 specs = fromMaybe [] $ Map.lookup "--pems" margs
1049 keyrings_ = fromMaybe [] $ Map.lookup "--keyrings" margs 1050 keyrings_ = fromMaybe [] $ Map.lookup "--keyrings" margs
1050 wallets = fromMaybe [] $ Map.lookup "--wallets" margs 1051 wallets = fromMaybe [] $ Map.lookup "--wallets" margs
1051 passphrase_fd = concat <$> Map.lookup "--passphrase-fd" margs 1052 passphrase_fd = concat <$> Map.lookup "--passphrase-fd" margs
1052 1053
1053 when (any isNothing keypairs0) $ do 1054 forM_ (take 1 $ filter (isNothing . fst)
1054 warn "Syntax error in key pair specification" 1055 $ zip keypairs0 specs ) $ \(_,badspec) -> do
1056 warn $ "Syntax error in key pair specification " ++ show badspec
1055 exitFailure 1057 exitFailure
1056 1058
1057 input_key <- maybe (return Nothing) 1059 input_key <- maybe (return Nothing)