summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2016-12-26 12:07:18 -0400
committerJoey Hess2016-12-26 12:07:18 -0400
commit577ff36472956689ef5bebbefe6770357e2785f4 (patch)
treef325c5b532b098d22e49bc27c7f3b8345c84192e /src/Propellor/CmdLine.hs
parente3dacfc402108d2da408f843542d82dcab58157d (diff)
Added --build option, which makes propellor simply build itself.
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 448abf62..7840cc33 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -26,6 +26,7 @@ usage h = hPutStrLn h $ unlines
, " propellor --init"
, " propellor"
, " propellor --spin targethost [--via relayhost]"
+ , " propellor --build"
, " propellor --add-key keyid"
, " propellor --rm-key keyid"
, " propellor --list-fields"
@@ -53,6 +54,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
@@ -101,6 +103,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