summaryrefslogtreecommitdiff
path: root/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-01 03:48:45 -0400
committerJoey Hess2014-04-01 03:48:45 -0400
commitbf4ba055287f46d6e125d8fd7870dd981d224fc8 (patch)
treeb792c4ac702e4a1fb57b3ebc8cec174e08dee739 /Propellor/CmdLine.hs
parent25c4d185037bcf0c7aa42a11dc0295914c128ddc (diff)
docker support is working in theory (but untested)
Diffstat (limited to 'Propellor/CmdLine.hs')
-rw-r--r--Propellor/CmdLine.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs
index 05df86bf..62f86e63 100644
--- a/Propellor/CmdLine.hs
+++ b/Propellor/CmdLine.hs
@@ -17,6 +17,7 @@ data CmdLine
| AddKey String
| Continue CmdLine
| SimpleSh FilePath
+ | Chain HostName
deriving (Read, Show, Eq)
usage :: IO a
@@ -45,6 +46,7 @@ processCmdLine = go =<< getArgs
Just cmdline -> return $ Continue cmdline
Nothing -> errorMessage "--continue serialization failure"
go ("--simplesh":f:[]) = return $ SimpleSh f
+ go ("--chain":h:[]) = return $ Chain h
go (h:[]) = return $ Run h
go [] = do
s <- takeWhile (/= '\n') <$> readProcess "hostname" ["-f"]
@@ -60,6 +62,7 @@ defaultMain getprops = go True =<< processCmdLine
go _ (Set host field) = setPrivData host field
go _ (AddKey keyid) = addKey keyid
go _ (SimpleSh f) = simpleSh f
+ go _ (Chain host) = withprops host $ print <=< ensureProperties'
go True cmdline@(Spin _) = buildFirst cmdline $ go False cmdline
go True cmdline = updateFirst cmdline $ go False cmdline
go False (Spin host) = withprops host $ const $ spin host