vfmt: enable colored warnings/errors (#8527)
parent
df0520b43a
commit
3ef4885094
|
@ -6,6 +6,7 @@ module main
|
|||
import os
|
||||
import os.cmdline
|
||||
import rand
|
||||
import term
|
||||
import v.ast
|
||||
import v.pref
|
||||
import v.fmt
|
||||
|
@ -30,6 +31,7 @@ struct FormatOptions {
|
|||
const (
|
||||
formatted_file_token = '\@\@\@' + 'FORMATTED_FILE: '
|
||||
vtmp_folder = util.get_vtmp_folder()
|
||||
term_colors = term.can_show_color_on_stderr()
|
||||
)
|
||||
|
||||
fn main() {
|
||||
|
@ -52,6 +54,9 @@ fn main() {
|
|||
is_noerror: '-noerror' in args
|
||||
is_verify: '-verify' in args
|
||||
}
|
||||
if term_colors {
|
||||
os.setenv('VCOLORS', 'always', true)
|
||||
}
|
||||
if foptions.is_verbose {
|
||||
eprintln('vfmt foptions: $foptions')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue