2020-03-13 20:52:49 +01:00
|
|
|
module vhelp
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
pub fn show_topic(topic string) {
|
2020-03-20 16:41:18 +01:00
|
|
|
vexe := os.real_path(os.getenv('VEXE'))
|
2020-03-13 20:52:49 +01:00
|
|
|
vroot := os.dir(vexe)
|
2020-07-17 13:03:07 +02:00
|
|
|
target_topic := os.join_path(vroot, 'cmd', 'v', 'help', '${topic}.txt')
|
2020-03-13 20:52:49 +01:00
|
|
|
content := os.read_file(target_topic) or {
|
|
|
|
eprintln('Unknown topic: $topic')
|
|
|
|
exit(1)
|
|
|
|
}
|
|
|
|
println(content)
|
|
|
|
}
|
2020-03-20 16:41:18 +01:00
|
|
|
|