From 9d2ec219bbd77bfca48a72b52fe5d0d3fcc0dcf7 Mon Sep 17 00:00:00 2001 From: Pieter van de Bruggen Date: Sun, 17 Apr 2011 22:23:44 -0700 Subject: (#7013) Add support for required options. This adds another hook into the generated wrapper, which invokes a method to validate arguments. This is used to raise an exception when required options have not been passed to the method. Reviewed-By: Daniel Pittman --- lib/puppet/interface/action.rb | 16 +++++++++++++--- lib/puppet/interface/option.rb | 6 ++++-- lib/puppet/interface/option_builder.rb | 6 +++++- 3 files changed, 22 insertions(+), 6 deletions(-) (limited to 'lib/puppet/interface') diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index b94298963..412e39449 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -83,10 +83,10 @@ class Puppet::Interface::Action # idea how motivated we were to make this cleaner. Sorry. --daniel 2011-03-31 internal_name = "#{@name} implementation, required on Ruby 1.8".to_sym - file = __FILE__ + "+eval" - line = __LINE__ + 1 + file = __FILE__ + "+eval" + line = __LINE__ + 1 wrapper = <