diff --git a/README.md b/README.md index 8f68f0267bb304e29179e671f374f02e004c2c6f..ca8beceb39ed7b0dce457a40716ab80c02838b94 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,11 @@ Filter and sort bugs using a [query](doc/queries.md): git bug ls "status:open sort:edit" ``` +Search for bugs by text content: +``` +git bug ls "foo bar" baz +``` + You can now use commands like `show`, `comment`, `open` or `close` to display and modify bugs. For more details about each command, you can run `git bug --help` or read the [command's documentation](doc/md/git-bug.md). ## Interactive terminal UI diff --git a/commands/ls.go b/commands/ls.go index 769d60ba3669eed16a2a9c841f53225e21739c8e..f6d654b1ba6df2a3d99407bca44a53ceda9f01b1 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -38,12 +38,18 @@ func newLsCommand() *cobra.Command { Short: "List bugs.", Long: `Display a summary of each bugs. -You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language or with flags.`, +You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language, flags, a natural language full text search, or a combination of the aforementioned.`, Example: `List open bugs sorted by last edition with a query: git bug ls status:open sort:edit-desc List closed bugs sorted by creation with flags: git bug ls --status closed --by creation + +Do a full text search of all bugs: +git bug ls "foo bar" baz + +Use queries, flags, and full text search: +git bug ls status:open --by creation "foo bar" baz `, PreRunE: loadBackend(env), PostRunE: closeBackend(env), diff --git a/doc/man/git-bug-ls.1 b/doc/man/git-bug-ls.1 index b77bc96971bb087c7e022de403ad6873f3eaee83..a0e60db78ee0256ecd2301a11144f3c4360a8cb4 100644 --- a/doc/man/git-bug-ls.1 +++ b/doc/man/git-bug-ls.1 @@ -16,7 +16,7 @@ git\-bug\-ls \- List bugs. Display a summary of each bugs. .PP -You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language or with flags. +You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language, flags, a natural language full text search, or a combination of the aforementioned. .SH OPTIONS @@ -76,6 +76,12 @@ git bug ls status:open sort:edit\-desc List closed bugs sorted by creation with flags: git bug ls \-\-status closed \-\-by creation +Do a full text search of all bugs: +git bug ls "foo bar" baz + +Use queries, flags, and full text search: +git bug ls status:open \-\-by creation "foo bar" baz + .fi .RE diff --git a/doc/md/git-bug_ls.md b/doc/md/git-bug_ls.md index e2721c7282444456c827c4959c9017e5fe803744..df54224fae5355d131757755364e5461e44a8590 100644 --- a/doc/md/git-bug_ls.md +++ b/doc/md/git-bug_ls.md @@ -6,7 +6,7 @@ List bugs. Display a summary of each bugs. -You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language or with flags. +You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language, flags, a natural language full text search, or a combination of the aforementioned. ``` git-bug ls [QUERY] [flags] @@ -21,6 +21,12 @@ git bug ls status:open sort:edit-desc List closed bugs sorted by creation with flags: git bug ls --status closed --by creation +Do a full text search of all bugs: +git bug ls "foo bar" baz + +Use queries, flags, and full text search: +git bug ls status:open --by creation "foo bar" baz + ``` ### Options