Skip to content

Commit

Permalink
zoekt-index: USAGE message if no arguments supplied (#827)
Browse files Browse the repository at this point in the history
Test Plan: go run ./cmd/zoekt-index prints out useful instructions
  • Loading branch information
keegancsmith committed Sep 18, 2024
1 parent be438ef commit 87f1948
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/zoekt-index/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ func main() {
ignoreDirs := flag.String("ignore_dirs", ".git,.hg,.svn", "comma separated list of directories to ignore.")
flag.Parse()

if flag.NArg() == 0 {
fmt.Fprintf(flag.CommandLine.Output(), "USAGE: %s [options] PATHS...\n", filepath.Base(os.Args[0]))
fmt.Fprintln(flag.CommandLine.Output(), "Options:")
flag.PrintDefaults()
os.Exit(1)
}

// Tune GOMAXPROCS to match Linux container CPU quota.
_, _ = maxprocs.Set()

Expand Down

0 comments on commit 87f1948

Please sign in to comment.