From ebc642b2141cfed7d10a64ff0bb67a417f5f37be Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Thu, 19 May 2011 12:04:59 -0700 Subject: (#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. --- lib/puppet/interface/action.rb | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit