mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
tools.vet: print help when passing no files or --help
/-help
flag after vet command (#21108)
This commit is contained in:
parent
bc68c87f21
commit
1e8d1a4d0b
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ import v.pref
|
||||||
import v.parser
|
import v.parser
|
||||||
import v.token
|
import v.token
|
||||||
import v.ast
|
import v.ast
|
||||||
|
import v.help
|
||||||
import term
|
import term
|
||||||
|
|
||||||
struct Vet {
|
struct Vet {
|
||||||
|
@ -50,6 +51,9 @@ fn main() {
|
||||||
// `v test-cleancode` passes also `-o tmpfolder` as well as all options in VFLAGS
|
// `v test-cleancode` passes also `-o tmpfolder` as well as all options in VFLAGS
|
||||||
paths = paths.filter(!it.starts_with(vtmp))
|
paths = paths.filter(!it.starts_with(vtmp))
|
||||||
}
|
}
|
||||||
|
if paths.len == 0 || '-help' in vet_options || '--help' in vet_options {
|
||||||
|
help.print_and_exit('vet')
|
||||||
|
}
|
||||||
for path in paths {
|
for path in paths {
|
||||||
if !os.exists(path) {
|
if !os.exists(path) {
|
||||||
eprintln('File/folder ${path} does not exist')
|
eprintln('File/folder ${path} does not exist')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue