Skip to content

Commit

Permalink
cmd/zoekt: allow multiple arguments (#868)
Browse files Browse the repository at this point in the history
They are interpreted as AND, ie.

    zoekt a b c

is equivalent to

    zoekt "a b c"
  • Loading branch information
hanwen-flow authored Nov 28, 2024
1 parent dadf09d commit 87a0b74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/zoekt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path/filepath"
"runtime/pprof"
"strings"
"time"

"github.com/felixge/fgprof"
Expand Down Expand Up @@ -164,7 +165,7 @@ func main() {
flag.Usage = func() {
name := os.Args[0]
fmt.Fprintf(os.Stderr, "Usage:\n\n %s [option] QUERY\n"+
"for example\n\n %s 'byte file:java -file:test'\n\n", name, name)
"for example\n\n %s byte file:java -file:test\n\n", name, name)
flag.PrintDefaults()
fmt.Fprintf(os.Stderr, "\n")
}
Expand All @@ -175,7 +176,7 @@ func main() {
flag.Usage()
os.Exit(2)
}
pat := flag.Arg(0)
pat := strings.Join(flag.Args(), " ")

if !*verbose {
log.SetOutput(io.Discard)
Expand Down

0 comments on commit 87a0b74

Please sign in to comment.