summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2009-06-10 18:10:40 +1000
committerJames Turnbull <james@lovedthanlost.net>2009-06-12 10:36:13 +1000
commit5f7455ea2f618ca7db4b45ee25666e0109f2abf6 (patch)
treeb6e23206bd157867b8557fb0b38a6400a9439445
parent134ae3e78f8562b2735737a36d994989a4614e4a (diff)
downloadpuppet-5f7455ea2f618ca7db4b45ee25666e0109f2abf6.tar.gz
puppet-5f7455ea2f618ca7db4b45ee25666e0109f2abf6.tar.xz
puppet-5f7455ea2f618ca7db4b45ee25666e0109f2abf6.zip
Fixed #2222 - Cleanup pi binary options and --help output
-rwxr-xr-xbin/pi40
-rw-r--r--lib/puppet/application/pi.rb18
2 files changed, 38 insertions, 20 deletions
diff --git a/bin/pi b/bin/pi
index 6ac759ed3..ee6a10cb6 100755
--- a/bin/pi
+++ b/bin/pi
@@ -5,13 +5,41 @@
#
# Print help about puppet types on the console. Run with '-h' to get detailed
# help.
+# = Usage
#
+# pi [-h|--help] [-p|--providers] [-l|--list] [-m|--meta]
+#
+# = Description
+#
+# Prints details of Puppet types, providers and metaparameters on the console.
+#
+# = Options
+#
+# help::
+# Print this help text
+#
+# providers::
+# Describe providers in detail
+#
+# list::
+# List all types
+#
+# meta::
+# List all metaparameters
+#
+# = Example
+#
+# pi --list
+#
+# = Author
+#
+# Luke Kanies
+#
+# = Copyright
+#
+# Copyright (c) 2005 Reductive Labs, LLC
+# Licensed under the GNU Public License
-# FIXME: (1) Formatting could be a lot prettier
-# (2) The command line options are kinda screwy; unclear how best to
-# present the various pieces of info to user
-
-require 'puppet/application'
require 'puppet/application/pi'
-Puppet::Application[:pi].run \ No newline at end of file
+Puppet::Application[:pi].run
diff --git a/lib/puppet/application/pi.rb b/lib/puppet/application/pi.rb
index 67fffdc1b..2d7b8d86d 100644
--- a/lib/puppet/application/pi.rb
+++ b/lib/puppet/application/pi.rb
@@ -175,21 +175,11 @@ class TypeDoc
end
-Puppet::Application.new(:pi,"#{$0} [options] [type]") do
- @opt_parser.separator(" Print documentation for puppet types and their parameters")
+Puppet::Application.new(:pi) do
- should_not_parse_config
-
- option("--short", "-s", "Only list parameters without detail") do |arg|
- options[:parameters] = false
- end
-
- option("--providers","-p", "Describe providers in detail")
- option("--list", "-l", "List all types")
- option("--meta","-m", "Include metaparams")
- option("--help","-h") do |v|
- puts @opt_parser
- end
+ option("--providers","-p")
+ option("--list", "-l")
+ option("--meta","-m")
preinit do
options[:parameters] = true