def handle_errors_and_help(options={})
return if !@all_flags
options[:argv] ||= ARGV
options[:level] ||= :not_strict
argv = options[:argv]
usage_flag "h","?"
properties "h", :long_form=>"help"
parse(argv,false)
if argv.help_requested?
if !argv.help_requested_on
show_help
elsif the_on = argv.help_requested_on
show_individual_extended_help(the_on.to_sym)
end
exit
end
if argv.extended_help_requested?
show_extended_help
exit
end
if argv.errors?
argv.errors.divulge_problems
exit
end
if argv.warnings? and options[:level] == :with_no_warnings
puts "In strict warning handling mode. Warnings will cause process to exit."
argv.warnings.each do |x|
puts " #{ x }"
end
puts "Please fix these warnings and try again."
exit
end
self.extend NewInterface
self.flag_value = argv.flag_value
self.errors = argv.errors
argv
end