Skip to content

Commit 9e10b23

Browse files
committed
tools: make v doctor show CFLAGS and LDFLAGS too (if set)
1 parent 6be298d commit 9e10b23

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

‎cmd/tools/vdoctor.v‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ fn (mut a App) collect_info() {
126126
a.line2('VMODULES', diagnose_dir(vmodules), vmodules)
127127
a.line2('VTMP', diagnose_dir(vtmp_dir), vtmp_dir)
128128
a.line2('Current working dir', diagnose_dir(getwd), getwd)
129-
vflags := os.getenv('VFLAGS')
130129
a.line('', '')
131-
if vflags != '' {
132-
a.line('env VFLAGS', '"${vflags}"')
133-
a.line('', '')
134-
}
130+
131+
a.line_env('VFLAGS')
132+
a.line_env('CFLAGS')
133+
a.line_env('LDFLAGS')
134+
135135
a.line('Git version', a.cmd(command: 'git --version'))
136136
a.line('V git status', a.git_info())
137137
a.line('.git/config present', os.is_file('.git/config').str())
@@ -188,6 +188,13 @@ fn (mut a App) line2(label string, value string, value2 string) {
188188
value2)}')
189189
}
190190

191+
fn (mut a App) line_env(env_var string) {
192+
value := os.getenv(env_var)
193+
if value != '' {
194+
a.line('env ${env_var}', '"${value}"')
195+
}
196+
}
197+
191198
fn (app &App) parse(config string, sep string) map[string]string {
192199
mut m := map[string]string{}
193200
lines := config.split_into_lines()

0 commit comments

Comments
 (0)