summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2015-06-24 15:30:10 -0400
committerjoe <joe@jerkface.net>2015-06-24 15:30:10 -0400
commitfa9b22ae73e7d08b473e51e782ed521c41ea11d6 (patch)
treef576041b02798f13597df4d92453c5fd725d2ee1 /kiki.hs
parentdeb93b1eb227be52322201f038c059eb4832b61a (diff)
Added --delete support to merge command (TODO: test)
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/kiki.hs b/kiki.hs
index 2f8275d..2d926a8 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -1202,6 +1202,7 @@ kiki "merge" [] = do
1202 , " | --flow=(fill|spill|sync)[,(subkeys|match=SPEC)]" 1202 , " | --flow=(fill|spill|sync)[,(subkeys|match=SPEC)]"
1203 , " | --create=CMD" 1203 , " | --create=CMD"
1204 , " | --autosign[=no]" 1204 , " | --autosign[=no]"
1205 , " | --delete=FINGERPRINT"
1205 , " | --" 1206 , " | --"
1206 , " | FILE ) ..."] 1207 , " | FILE ) ..."]
1207kiki "merge" args | "--help" `elem` args = do 1208kiki "merge" args | "--help" `elem` args = do
@@ -1267,6 +1268,10 @@ kiki "merge" args = do
1267 ( flow 1268 ( flow
1268 , op { opFiles= Map.insert (ArgFile fname) flow (opFiles op) }) 1269 , op { opFiles= Map.insert (ArgFile fname) flow (opFiles op) })
1269 1270
1271 doDelete :: String -> StreamInfo -> KeyRingOperation -> (StreamInfo,KeyRingOperation)
1272 doDelete fp flow op = ( flow
1273 , op { opTransforms = opTransforms op ++ [DeleteSubKey fp] } )
1274
1270 doAutosign :: Bool -> StreamInfo -> KeyRingOperation -> (StreamInfo,KeyRingOperation) 1275 doAutosign :: Bool -> StreamInfo -> KeyRingOperation -> (StreamInfo,KeyRingOperation)
1271 doAutosign True flow op = 1276 doAutosign True flow op =
1272 if Map.null (opFiles op) 1277 if Map.null (opFiles op)
@@ -1295,6 +1300,7 @@ kiki "merge" args = do
1295 dispatch = 1300 dispatch =
1296 case parsed of 1301 case parsed of
1297 Right fname -> doFile flow op fname 1302 Right fname -> doFile flow op fname
1303 Left ("delete",Just fp) -> doDelete fp flow op
1298 Left ("autosign",Nothing) -> doAutosign True flow op 1304 Left ("autosign",Nothing) -> doAutosign True flow op
1299 Left ("autosign",Just "y") -> doAutosign True flow op 1305 Left ("autosign",Just "y") -> doAutosign True flow op
1300 Left ("autosign",Just "yes") -> doAutosign True flow op 1306 Left ("autosign",Just "yes") -> doAutosign True flow op