From 4d75346187557ae59736ca5739bfae312c285e08 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 3 Aug 2019 14:20:36 +0900 Subject: Refine error message Highlight failed command and suggest installing the command. [Bug #16042] --- tool/pure_parser.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tool') diff --git a/tool/pure_parser.rb b/tool/pure_parser.rb index 4d5e86e543..9ab663830e 100755 --- a/tool/pure_parser.rb +++ b/tool/pure_parser.rb @@ -4,7 +4,12 @@ BEGIN { colorize = Colorize.new file = ARGV.shift - unless /\Abison .* (\d+)\.\d+/ =~ IO.popen(ARGV+%w[--version], &:read) + begin + version = IO.popen(ARGV+%w[--version], &:read) + rescue Errno::ENOENT + abort "Failed to run `#{colorize.fail ARGV.join(' ')}'; You may have to install it." + end + unless /\Abison .* (\d+)\.\d+/ =~ version puts colorize.fail("not bison") exit end -- cgit v1.2.3