Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools.vet: print help when passing no files or --help/-help flag after vet command #21108

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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