lib/rcoli/model.rb in rcoli-0.5.11 vs lib/rcoli/model.rb in rcoli-0.5.12
- old
+ new
@@ -91,11 +91,11 @@
result = commands.find{|command| command.value_of_name.to_s.eql? name}
return result
end
def validate_options(result, target)
- if (result.command.value_of_force == true)
+ if (result.command.nil? or result.command.value_of_force == true)
return
else
self.options.find_all{|o| o.is_a? Flag and o.value_of_required}.each do |o|
raise InvalidCommand, "Required option '#{o.to_s}' is missing" unless o.keys.find{|key| result.send(target)[key]}
end
@@ -220,10 +220,10 @@
# execution of the main block
context.instance_exec(result.global_options, result.options, result.arguments, &action)
# execution of the post block
context.instance_exec(result.global_options, result.options, result.arguments, &@post_action) if (@post_action and !result.command.value_of_skip_post)
else
- say "This feature is comming soon. Now you should execute '#{value_of_name} help'"
+ say "This feature is comming soon. You should execute '#{value_of_name} help' now."
end
end
def pre(&block)
@pre_action = block
\ No newline at end of file