From b34b56ee4e5a0578eb1786cc5175a3cf7a37f829 Mon Sep 17 00:00:00 2001 From: zakuro Date: Sat, 8 May 2021 01:31:43 +0900 Subject: [PATCH] vbug: use readline to read expected result (#10037) --- cmd/tools/vbug.v | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/tools/vbug.v b/cmd/tools/vbug.v index 05149202e7..a8c79c2a7a 100644 --- a/cmd/tools/vbug.v +++ b/cmd/tools/vbug.v @@ -1,6 +1,7 @@ import dl import net.urllib import os +import readline // get output from `v doctor` fn get_vdoctor_output(is_verbose bool) string { @@ -153,7 +154,11 @@ fn main() { confirm_or_exit('An error occured retrieving the information, do you want to continue?') } - expected_result := os.input_opt('What did you expect to see? ') or { '' } + expected_result := readline.read_line('What did you expect to see? ') or { + // Ctrl-C was pressed + eprintln('\nCanceled') + exit(1) + } // open prefilled issue creation page, or print link as a fallback if !is_yes && vdoctor_output.contains('behind V master') {