From a6bbf31d0b907181e6afa9e198ca42c07d681055 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Fri, 9 Apr 2021 16:32:26 +0200 Subject: [PATCH] B #5311: show CLI errors always on STDERR (#1087) --- src/cli/command_parser.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/command_parser.rb b/src/cli/command_parser.rb index 0750bb5b3e..01b959f8c4 100644 --- a/src/cli/command_parser.rb +++ b/src/cli/command_parser.rb @@ -481,9 +481,12 @@ module CommandParser begin rc = comm[:proc].call - if rc.instance_of?(Array) + if rc.instance_of?(Array) && rc[0] != 0 + STDERR.puts rc[1] + exit(rc[0]) + elsif rc.instance_of?(Array) puts rc[1] - exit rc.first + exit(rc[0]) else exit(@exit_code || rc) end