summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornfagerlund <nick.fagerlund@gmail.com>2011-05-19 12:04:59 -0700
committernfagerlund <nick.fagerlund@gmail.com>2011-05-26 10:07:40 -0700
commit89d447bf425c98407e139eb2a9737906fd45e369 (patch)
treeb4ba1dc7d87b888bac685ca98be95eaebd0ac112 /lib
parentf50da8bec7280a2816d9d967152ff83a2e888374 (diff)
downloadpuppet-89d447bf425c98407e139eb2a9737906fd45e369.tar.gz
puppet-89d447bf425c98407e139eb2a9737906fd45e369.tar.xz
puppet-89d447bf425c98407e139eb2a9737906fd45e369.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')
-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