summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-06-19 14:41:55 -0400
committerJoey Hess2014-06-19 14:48:15 -0400
commit42594d6b4c14a21efc42e262e52c2c67f30c67c3 (patch)
treea8f8b2f4a2007bd12bc7b81ef788548805ff713f /src/Propellor/CmdLine.hs
parente3b53bf28996ad5eee96c1ca9f9ef39a7d10b358 (diff)
Add --edit to edit a privdata value in $EDITOR
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 32e97316..c084355b 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -26,9 +26,10 @@ usage = do
, " propellor"
, " propellor hostname"
, " propellor --spin hostname"
+ , " propellor --add-key keyid"
, " propellor --set hostname field"
, " propellor --dump hostname field"
- , " propellor --add-key keyid"
+ , " propellor --edit hostname field"
]
exitFailure
@@ -41,6 +42,7 @@ processCmdLine = go =<< getArgs
go ("--add-key":k:[]) = return $ AddKey k
go ("--set":h:f:[]) = withprivfield f (return . Set h)
go ("--dump":h:f:[]) = withprivfield f (return . Dump h)
+ go ("--edit":h:f:[]) = withprivfield f (return . Edit h)
go ("--continue":s:[]) = case readish s of
Just cmdline -> return $ Continue cmdline
Nothing -> errorMessage "--continue serialization failure"
@@ -71,6 +73,7 @@ defaultMain hostlist = do
go _ (Continue cmdline) = go False cmdline
go _ (Set hn field) = setPrivData hn field
go _ (Dump hn field) = dumpPrivData hn field
+ go _ (Edit hn field) = editPrivData hn field
go _ (AddKey keyid) = addKey keyid
go _ (Chain hn) = withhost hn $ \h -> do
r <- runPropellor h $ ensureProperties $ hostProperties h