summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index c407fce8..f26e0834 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -26,19 +26,19 @@ usage h = hPutStrLn h $ unlines
[ "Usage:"
, " propellor --init"
, " propellor"
- , " propellor hostname"
, " propellor --spin targethost [--via relayhost]"
+ , " propellor --build"
, " propellor --add-key keyid"
, " propellor --rm-key keyid"
, " propellor --list-fields"
- , " propellor --dump field context"
- , " propellor --edit field context"
, " propellor --set field context"
, " propellor --unset field context"
, " propellor --unset-unused"
+ , " propellor --dump field context"
+ , " propellor --edit field context"
, " propellor --merge"
- , " propellor --build"
, " propellor --check"
+ , " propellor hostname"
]
usageError :: [String] -> IO a
@@ -55,6 +55,7 @@ processCmdLine = go =<< getArgs
<$> mapM hostname (reverse hs)
<*> pure (Just r)
_ -> Spin <$> mapM hostname ps <*> pure Nothing
+ go ("--build":[]) = return Build
go ("--add-key":k:[]) = return $ AddKey k
go ("--rm-key":k:[]) = return $ RmKey k
go ("--set":f:c:[]) = withprivfield f c Set
@@ -104,6 +105,7 @@ defaultMain hostlist = withConcurrentOutput $ do
where
go cr (Serialized cmdline) = go cr cmdline
go _ Check = return ()
+ go cr Build = buildFirst Nothing cr Build $ return ()
go _ (Set field context) = setPrivData field context
go _ (Unset field context) = unsetPrivData field context
go _ (UnsetUnused) = unsetPrivDataUnused hostlist