From 42594d6b4c14a21efc42e262e52c2c67f30c67c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Jun 2014 14:41:55 -0400 Subject: Add --edit to edit a privdata value in $EDITOR --- src/Propellor/CmdLine.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Propellor/CmdLine.hs') 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 -- cgit v1.3-2-g0d8e