Skip to content

Commit

Permalink
tools.vet: print help when passing no files or --help/-help flag …
Browse files Browse the repository at this point in the history
…after vet command (#21108)
  • Loading branch information
ttytm authored Mar 27, 2024
1 parent bc68c87 commit 1e8d1a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/tools/vvet/vvet.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import v.pref
import v.parser
import v.token
import v.ast
import v.help
import term

struct Vet {
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 1e8d1a4

Please sign in to comment.