mirror of
https://github.com/vlang/v.git
synced 2025-09-12 00:46:55 -04: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
@ -9,6 +9,7 @@ import v.pref
|
||||
import v.parser
|
||||
import v.token
|
||||
import v.ast
|
||||
import v.help
|
||||
import term
|
||||
|
||||
struct Vet {
|
||||
@ -50,6 +51,9 @@ fn main() {
|
||||
// `v test-cleancode` passes also `-o tmpfolder` as well as all options in VFLAGS
|
||||
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 {
|
||||
if !os.exists(path) {
|
||||
eprintln('File/folder ${path} does not exist')
|
||||
|
Loading…
x
Reference in New Issue
Block a user