diff options
-rw-r--r-- | kiki.hs | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -1286,7 +1286,7 @@ kiki "show" args = do | |||
1286 | 1286 | ||
1287 | kiki "merge" [] = do | 1287 | kiki "merge" [] = do |
1288 | putStr . unlines $ | 1288 | putStr . unlines $ |
1289 | [ "kiki merge [ ( --passphrase-fd=FD | --agent | --show-key=SPEC ) ... ]" | 1289 | [ "kiki merge [ ( --passphrase-fd=FD | --agent | --show-key=SPEC | --show-all ) ... ]" |
1290 | , " ( --home[=HOMEDIR]" | 1290 | , " ( --home[=HOMEDIR]" |
1291 | , " | --type=(keyring|pem|wallet|hosts|dns)" | 1291 | , " | --type=(keyring|pem|wallet|hosts|dns)" |
1292 | , " | --access=[auto|secret|public]" | 1292 | , " | --access=[auto|secret|public]" |
@@ -1306,6 +1306,9 @@ kiki "merge" [] = do | |||
1306 | , "" | 1306 | , "" |
1307 | , " --agent Use gpg-agent." | 1307 | , " --agent Use gpg-agent." |
1308 | , "" | 1308 | , "" |
1309 | , " --show-all After files have been written, show information for all" | ||
1310 | , " known keys." | ||
1311 | , "" | ||
1309 | , " --show-key=SPEC After files have been written, show information for the" | 1312 | , " --show-key=SPEC After files have been written, show information for the" |
1310 | , " key identified by SPEC." | 1313 | , " key identified by SPEC." |
1311 | , "" | 1314 | , "" |
@@ -1339,17 +1342,22 @@ kiki "merge" args = do | |||
1339 | KikiResult rt report <- runKeyRing (mbAgent op) | 1342 | KikiResult rt report <- runKeyRing (mbAgent op) |
1340 | case rt of | 1343 | case rt of |
1341 | KikiSuccess rt -> do let db = rtKeyDB rt | 1344 | KikiSuccess rt -> do let db = rtKeyDB rt |
1342 | forM_ keyspecs $ \keyspec -> do | 1345 | if bShowAll |
1343 | show_id keyspec (error "show_id wkgrip") db | 1346 | then show_all db |
1347 | else forM_ keyspecs $ \keyspec -> do | ||
1348 | show_id keyspec (error "show_id wkgrip") db | ||
1344 | err -> putStrLn $ errorString err | 1349 | err -> putStrLn $ errorString err |
1345 | forM_ report $ \(fname,act) -> do | 1350 | forM_ report $ \(fname,act) -> do |
1346 | putStrLn $ fname ++ ": " ++ reportString act | 1351 | putStrLn $ fname ++ ": " ++ reportString act |
1347 | where | 1352 | where |
1348 | (_,((_,keyspecs),op)) = foldl' buildOp (True,((flow0,[]),noop)) args' | 1353 | (_,((_,keyspecs),op)) = foldl' buildOp (True,((flow0,[]),noop)) args'' |
1349 | (args',mbAgent) = case break (=="--agent") args of | 1354 | (args',mbAgent) = case break (=="--agent") args of |
1350 | (as,[]) -> (args, id) | 1355 | (as,[]) -> (args, id) |
1351 | (as,_:bs) -> ( as++bs | 1356 | (as,_:bs) -> ( as++bs |
1352 | , \op -> op { opPassphrases = withAgent (opPassphrases op) }) | 1357 | , \op -> op { opPassphrases = withAgent (opPassphrases op) }) |
1358 | (args'',bShowAll) = case break (=="--show-all") args' of | ||
1359 | (as,[]) -> (args, False) | ||
1360 | (as,_:bs) -> ( as++bs, True) | ||
1353 | noop = KeyRingOperation | 1361 | noop = KeyRingOperation |
1354 | { opFiles = Map.empty | 1362 | { opFiles = Map.empty |
1355 | , opTransforms = [] | 1363 | , opTransforms = [] |