1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

help: print errors to stderr (#6486)

This commit is contained in:
Denis 2020-09-28 07:14:34 +03:00 committed by GitHub
parent 0e2f267805
commit 6981f2afeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,12 +15,12 @@ pub fn print_and_exit(topic string) {
if (b >= `a` && b <= `z`) || b == `-` || (b >= `0` && b <= `9`) {
continue
}
println(unknown_topic)
eprintln(unknown_topic)
exit(1)
}
target_topic := os.join_path(vroot, 'cmd', 'v', 'help', '${topic}.txt')
content := os.read_file(target_topic) or {
println(unknown_topic)
eprintln(unknown_topic)
exit(1)
}
println(content)