summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--doc/todo/usage__47__help_text_improvements.mdwn2
-rw-r--r--src/Propellor/CmdLine.hs46
3 files changed, 33 insertions, 16 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f41c556f..eef6c1de 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ propellor (3.2.4) UNRELEASED; urgency=medium
* GHC's fileSystemEncoding is used for all String IO, to avoid
encoding-related crashes in eg, Propellor.Property.File.
* Add --build option to simply build config.hs.
+ * More informative usage message. Thanks, Daniel Brooks
-- Joey Hess <id@joeyh.name> Sat, 24 Dec 2016 15:06:36 -0400
diff --git a/doc/todo/usage__47__help_text_improvements.mdwn b/doc/todo/usage__47__help_text_improvements.mdwn
index 8ffca2c0..80fffb3d 100644
--- a/doc/todo/usage__47__help_text_improvements.mdwn
+++ b/doc/todo/usage__47__help_text_improvements.mdwn
@@ -1 +1,3 @@
I started out looking at how to make usage.mdwn into a man page, but that's a little more work than I wanted to do tonight. Instead, I added more information to the usage message. Commit is fa0e8d83 on iabak:~db48x/propellor if you want it.
+
+> merged [[done]] tnx --[[Joey]]
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index f26e0834..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:"
- , " 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"
- ]
+ , " 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