vbug: use readline to read expected result (#10037)

pull/10046/head
zakuro 2021-05-08 01:31:43 +09:00 committed by GitHub
parent d26ac5692e
commit b34b56ee4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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') {