From e3dacfc402108d2da408f843542d82dcab58157d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Dec 2016 11:54:37 -0400 Subject: get usage and man page back in sync Remove --build which is no longer present. Order the list of options the same. Document --rm-key in man page. --- src/Propellor/CmdLine.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index fc256109..448abf62 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -25,19 +25,18 @@ usage h = hPutStrLn h $ unlines [ "Usage:" , " propellor --init" , " propellor" - , " propellor hostname" , " propellor --spin targethost [--via relayhost]" , " 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 -- cgit v1.3-2-g0d8e 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. --- debian/changelog | 6 ++++++ doc/usage.mdwn | 8 ++++++++ src/Propellor/CmdLine.hs | 3 +++ src/Propellor/Types/CmdLine.hs | 1 + 4 files changed, 18 insertions(+) (limited to 'src/Propellor/CmdLine.hs') diff --git a/debian/changelog b/debian/changelog index cb313e2f..765f44c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (3.2.4) UNRELEASED; urgency=medium + + * Added --build option, which makes propellor simply build itself. + + -- Joey Hess Mon, 26 Dec 2016 12:03:19 -0400 + propellor (3.2.3) unstable; urgency=medium * Improve extraction of gpg secret key id list, to work with gpg 2.1. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index fc1f8391..3d32538f 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -55,6 +55,14 @@ and configured in haskell. The hostname given to --spin can be a short name, which is then looked up in the DNS to find the FQDN. +* propellor --build + + Causes propellor to build itself, checking that your config.hs, etc are + valid. + + You do not need to run this as a separate step; propellor automatically + builds itself when using things like --spin. + * propellor --add-key keyid Adds a gpg key, which is used to encrypt the privdata. 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.3-2-g0d8e From fa0e8d8389074c2cc08ca4911080fac0252acbd1 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Mon, 26 Dec 2016 21:07:20 -0500 Subject: add a little more information to the usage text --- src/Propellor/CmdLine.hs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index f26e0834..9982372c 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -24,22 +24,22 @@ import Utility.FileSystemEncoding usage :: Handle -> IO () usage h = hPutStrLn h $ unlines [ "Usage:" - , " propellor --init" - , " propellor" - , " propellor --spin targethost [--via relayhost]" - , " propellor --build" - , " propellor --add-key keyid" - , " propellor --rm-key keyid" - , " propellor --list-fields" - , " propellor --set field context" - , " propellor --unset field context" - , " propellor --unset-unused" - , " propellor --dump field context" - , " propellor --edit field context" - , " propellor --merge" - , " propellor --check" - , " propellor hostname" - ] + , " --init\t\t initialize ~/.propellor" + , " \t\t\t with no arguments, provision the current host" + , " hostname\t\t provision the current host as if it had the specified hostname" + , " --spin targethost [--via relayhost] " + , " \t\t\t provision the specified host" + , " --build\t\t recompile using your current config" + , " --add-key keyid\t add an additional signing key to the private data" + , " --rm-key keyid\t remove a signing key from the private data" + , " --list-fields\t\t list private data fields" + , " --set field context\t set a private data field" + , " --unset field context\t clear a private data field" + , " --unset-unused\t clear unused fields from the private data" + , " --dump field context\t show the content of a private data field" + , " --edit field context\t edit the content of a private data field" + , " --merge\t\t combine multiple spins into a single git commit" + , " --check\t\t double-check that propellor can actually run here"] usageError :: [String] -> IO a usageError ps = do -- cgit v1.3-2-g0d8e From 289afbc22f3ac0f08b9c785ef4c8b996a404203f Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Tue, 27 Dec 2016 01:12:03 -0500 Subject: use fewer tabs --- src/Propellor/CmdLine.hs | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 9982372c..a36ec7f5 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -24,22 +24,36 @@ import Utility.FileSystemEncoding usage :: Handle -> IO () usage h = hPutStrLn h $ unlines [ "Usage:" - , " --init\t\t initialize ~/.propellor" - , " \t\t\t with no arguments, provision the current host" - , " hostname\t\t provision the current host as if it had the specified hostname" - , " --spin targethost [--via relayhost] " - , " \t\t\t provision the specified host" - , " --build\t\t recompile using your current config" - , " --add-key keyid\t add an additional signing key to the private data" - , " --rm-key keyid\t remove a signing key from the private data" - , " --list-fields\t\t list private data fields" - , " --set field context\t set a private data field" - , " --unset field context\t clear a private data field" - , " --unset-unused\t clear unused fields from the private data" - , " --dump field context\t show the content of a private data field" - , " --edit field context\t edit the content of a private data field" - , " --merge\t\t combine multiple spins into a single git commit" - , " --check\t\t double-check that propellor can actually run here"] + , " with no arguments, provision the current host" + , "" + , " --init" + , " initialize ~/.propellor" + , " hostname" + , " provision the current host as if it had the specified hostname" + , " --spin targethost [--via relayhost]" + , " provision the specified host" + , " --build" + , " recompile using your current config" + , " --add-key keyid" + , " add an additional signing key to the private data" + , " --rm-key keyid" + , " remove a signing key from the private data" + , " --list-fields" + , " list private data fields" + , " --set field context" + , " set a private data field" + , " --unset field context" + , " clear a private data field" + , " --unset-unused" + , " clear unused fields from the private data" + , " --dump field context" + , " show the content of a private data field" + , " --edit field context" + , " edit the content of a private data field" + , " --merge" + , " combine multiple spins into a single git commit" + , " --check" + , " double-check that propellor can actually run here"] usageError :: [String] -> IO a usageError ps = do -- cgit v1.3-2-g0d8e