lib/fig/command.rb in fig-1.16.0 vs lib/fig/command.rb in fig-1.16.1.beta.1

- old
+ new

@@ -23,10 +23,12 @@ module Fig; end # Main program class Fig::Command def run_fig(argv, options = nil) + @suppress_further_error_messages = false + begin @options = options || Fig::Command::Options.new() @options.process_command_line(argv) rescue Fig::UserInputError => error $stderr.puts error.to_s # Logging isn't set up yet. @@ -99,10 +101,12 @@ "Access to #{urls} in #{error.package}/#{error.version} not allowed." rescue Fig::UserInputError => error log_error_message(error) end + @suppress_further_error_messages = true + return Fig::Command::Action::EXIT_FAILURE end # Extension mechanism for customizing Fig. def add_post_set_up_action(action) @@ -277,10 +281,14 @@ environment_variables, @working_directory_maintainer, ) if check_for_unused_retrieves? - Fig::AtExit.add { @environment.check_for_unused_retrieves } + Fig::AtExit.add { + if ! @suppress_further_error_messages + @environment.check_for_unused_retrieves + end + } end return end