1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/cmd/tools/modules/vhelp/vhelp.v
2020-03-13 20:52:49 +01:00

16 lines
318 B
V

module vhelp
import os
pub fn show_topic(topic string) {
vexe := os.realpath(os.getenv('VEXE'))
vroot := os.dir(vexe)
target_topic := os.join_path(vroot,'cmd','v','internal','help','${topic}.txt')
content := os.read_file(target_topic) or {
eprintln('Unknown topic: $topic')
exit(1)
}
println(content)
}