summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface
diff options
context:
space:
mode:
authornfagerlund <nick.fagerlund@gmail.com>2011-05-19 12:04:59 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-05-26 16:04:42 -0700
commitebc642b2141cfed7d10a64ff0bb67a417f5f37be (patch)
tree929c9c6944ab542d2f1fb15a738034e4dd4c84f6 /lib/puppet/interface
parent2ebd2d9eda3c556244cda1ae62da95965a92d79b (diff)
downloadpuppet-ebc642b2141cfed7d10a64ff0bb67a417f5f37be.tar.gz
puppet-ebc642b2141cfed7d10a64ff0bb67a417f5f37be.tar.xz
puppet-ebc642b2141cfed7d10a64ff0bb67a417f5f37be.zip
(#6962) Add "arguments" method to help API
Since some actions take arguments and some do not, action synopses were incomplete and ambiguous. This commit adds a method for explicitly declaring what argument(s) an action takes, and places the arguments at the appropriate spot in the action's synopsis. By convention, individual arguments should be wrapped in angle brackets.
Diffstat (limited to 'lib/puppet/interface')
-rw-r--r--lib/puppet/interface/action.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb
index 3c377a49f..748888c2e 100644
--- a/lib/puppet/interface/action.rb
+++ b/lib/puppet/interface/action.rb
@@ -46,6 +46,7 @@ class Puppet::Interface::Action
########################################################################
# Documentation...
attr_doc :returns
+ attr_doc :arguments
def synopsis
output = PrettyPrint.format do |s|
s.text("puppet #{@face.name}")
@@ -67,6 +68,7 @@ class Puppet::Interface::Action
end
end
end
+ s.text(" #{arguments}") if arguments
end
end