From b6ea6fcee16c3ef65adff62d532346a3dee1f4fa Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Fri, 5 Jul 2019 22:40:47 -0400 Subject: Tweaked merge command. Default --flow=spill, new option --packets. --- kiki.hs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/kiki.hs b/kiki.hs index eb043f8..11f9fb4 100644 --- a/kiki.hs +++ b/kiki.hs @@ -1286,7 +1286,11 @@ kiki "show" args = do kiki "merge" [] = do putStr . unlines $ - [ "kiki merge [ ( --passphrase-fd=FD | --agent | --show-key=SPEC | --show-all ) ... ]" + [ "kiki merge [ ( --passphrase-fd=FD" + , " | --agent" + , " | --show-key=SPEC" + , " | --show-all" + , " | --packets ) ... ]" , " ( --home[=HOMEDIR]" , " | --type=(keyring|pem|wallet|hosts|dns)" , " | --access=[auto|secret|public]" @@ -1312,6 +1316,8 @@ kiki "merge" [] = do , " --show-key=SPEC After files have been written, show information for the" , " key identified by SPEC." , "" + , " --packets After files have been written, declare each known pkg packet." + , "" , " FILE A path to a key file to read or update." , "" , "MODIFIERS" @@ -1325,6 +1331,8 @@ kiki "merge" [] = do , " --access=[auto|secret|public]" , "" , " --flow=(fill|spill|sync)[,(subkeys|signed|match=SPEC)]" + , " If not specified, default is to spill (read and use but" + , " don't write)." , "" , " --create=(rsa:SIZE|cmd:CMD)" , "" @@ -1346,18 +1354,22 @@ kiki "merge" args = do then show_all db else forM_ keyspecs $ \keyspec -> do show_id keyspec (error "show_id wkgrip") db + when bPackets $ show_packets [] db err -> putStrLn $ errorString err forM_ report $ \(fname,act) -> do putStrLn $ fname ++ ": " ++ reportString act where - (_,((_,keyspecs),op)) = foldl' buildOp (True,((flow0,[]),noop)) args'' + (_,((_,keyspecs),op)) = foldl' buildOp (True,((flow0,[]),noop)) args3 (args',mbAgent) = case break (=="--agent") args of - (as,[]) -> (args, id) + (as,[]) -> (as, id) (as,_:bs) -> ( as++bs , \op -> op { opPassphrases = withAgent (opPassphrases op) }) (args'',bShowAll) = case break (=="--show-all") args' of - (as,[]) -> (args, False) - (as,_:bs) -> ( as++bs, True) + (as,[]) -> (as, False) + (as,_:bs) -> (as++bs, True) + (args3,bPackets) = case break (=="--packets") args'' of + (as,[]) -> (as, False) + (as,_:bs) -> (as++bs, True) noop = KeyRingOperation { opFiles = Map.empty , opTransforms = [] @@ -1367,7 +1379,7 @@ kiki "merge" args = do flow0 = StreamInfo { access = AutoAccess , typ = KeyRingFile - , spill = KF_None + , spill = KF_All , fill = KF_None , initializer = NoCreate , transforms = [] -- cgit v1.2.3