mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v: move cmd/v/help/ to vlib/v/help, to simplify the interaction between module lookup & v recompilation (#16867)
This commit is contained in:
parent
b8571c964d
commit
f9e8a91cd0
|
@ -5,7 +5,7 @@ import os
|
||||||
pub fn show_topic(topic string) {
|
pub fn show_topic(topic string) {
|
||||||
vexe := os.real_path(os.getenv('VEXE'))
|
vexe := os.real_path(os.getenv('VEXE'))
|
||||||
vroot := os.dir(vexe)
|
vroot := os.dir(vexe)
|
||||||
target_topic := os.join_path(vroot, 'cmd', 'v', 'help', '${topic}.txt')
|
target_topic := os.join_path(vroot, 'vlib', 'v', 'help', '${topic}.txt')
|
||||||
content := os.read_file(target_topic) or {
|
content := os.read_file(target_topic) or {
|
||||||
eprintln('Unknown topic: ${topic}')
|
eprintln('Unknown topic: ${topic}')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
module main
|
module main
|
||||||
|
|
||||||
import help
|
|
||||||
import os
|
import os
|
||||||
import term
|
import term
|
||||||
|
import v.help
|
||||||
import v.pref
|
import v.pref
|
||||||
import v.util
|
import v.util
|
||||||
import v.util.version
|
import v.util.version
|
||||||
|
|
|
@ -11,7 +11,7 @@ const (
|
||||||
pub fn print_and_exit(topic string) {
|
pub fn print_and_exit(topic string) {
|
||||||
vexe := pref.vexe_path()
|
vexe := pref.vexe_path()
|
||||||
vroot := os.dir(vexe)
|
vroot := os.dir(vexe)
|
||||||
topicdir := os.join_path(vroot, 'cmd', 'v', 'help')
|
topicdir := os.join_path(vroot, 'vlib', 'v', 'help')
|
||||||
|
|
||||||
for b in topic {
|
for b in topic {
|
||||||
if (b >= `a` && b <= `z`) || b == `-` || (b >= `0` && b <= `9`) {
|
if (b >= `a` && b <= `z`) || b == `-` || (b >= `0` && b <= `9`) {
|
Loading…
Reference in New Issue
Block a user