From 577ff36472956689ef5bebbefe6770357e2785f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Dec 2016 12:07:18 -0400 Subject: Added --build option, which makes propellor simply build itself. --- src/Propellor/CmdLine.hs | 3 +++ src/Propellor/Types/CmdLine.hs | 1 + 2 files changed, 4 insertions(+) (limited to 'src/Propellor') 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 diff --git a/src/Propellor/Types/CmdLine.hs b/src/Propellor/Types/CmdLine.hs index 558c6e8b..d712a456 100644 --- a/src/Propellor/Types/CmdLine.hs +++ b/src/Propellor/Types/CmdLine.hs @@ -28,4 +28,5 @@ data CmdLine | ChrootChain HostName FilePath Bool Bool | GitPush Fd Fd | Check + | Build deriving (Read, Show, Eq) -- cgit v1.2.3