Skip to content

Commit 5824ce4

Browse files
authored
search: add a tip about negated searches (#720)
1 parent 1c260bc commit 5824ce4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/src/search.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ Other tips:
4949
Force color output on (not on by default when piped to other programs) by setting COLOR=t
5050
5151
Query syntax: https://about.sourcegraph.com/docs/search/query-syntax/
52+
53+
Be careful with search strings including negation: a search with an initial
54+
negated term may be parsed as a flag rather than as a search string. You can
55+
use -- to ensure that src parses this correctly, eg:
56+
57+
$ src search -- '-repo:github.com/foo/bar error'
5258
`
5359

5460
flagSet := flag.NewFlagSet("search", flag.ExitOnError)

0 commit comments

Comments
 (0)