From d71411f9179d2930e791c4f9d3a7accef9b80eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 19 Sep 2018 21:50:03 +0200 Subject: [PATCH] commands: ls now accept queries without quote --- commands/ls.go | 5 +++-- doc/man/git-bug-ls.1 | 2 +- doc/md/git-bug_ls.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/ls.go b/commands/ls.go index 7bab429d264754e141a153c07405187be7b687d4..ad45eefad11845bbefe162295b675e88434953e5 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -2,6 +2,7 @@ package commands import ( "fmt" + "strings" "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" @@ -27,7 +28,7 @@ func runLsBug(cmd *cobra.Command, args []string) error { var query *cache.Query if len(args) >= 1 { - query, err = cache.ParseQuery(args[0]) + query, err = cache.ParseQuery(strings.Join(args, " ")) if err != nil { return err @@ -133,7 +134,7 @@ var lsCmd = &cobra.Command{ 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.`, Example: `List open bugs sorted by last edition with a query: -git bug ls "status:open sort:edit-desc" +git bug ls status:open sort:edit-desc List closed bugs sorted by creation with flags: git bug ls --status closed --by creation diff --git a/doc/man/git-bug-ls.1 b/doc/man/git-bug-ls.1 index c5f989a8b67d1d3f79da75a66e8039ec0b8191a7..5f799c30a6b8b4ecefdd157b1f21ba65333e9e6f 100644 --- a/doc/man/git-bug-ls.1 +++ b/doc/man/git-bug-ls.1 @@ -57,7 +57,7 @@ You can pass an additional query to filter and order the list. This query can be .nf List open bugs sorted by last edition with a query: -git bug ls "status:open sort:edit\-desc" +git bug ls status:open sort:edit\-desc List closed bugs sorted by creation with flags: git bug ls \-\-status closed \-\-by creation diff --git a/doc/md/git-bug_ls.md b/doc/md/git-bug_ls.md index 53f9b7f48a285972756f5892d769f22338f2e8a4..a1ebad20f250a0abd3aebbfc2f124d3df2a51bdc 100644 --- a/doc/md/git-bug_ls.md +++ b/doc/md/git-bug_ls.md @@ -16,7 +16,7 @@ git-bug ls [] [flags] ``` List open bugs sorted by last edition with a query: -git bug ls "status:open sort:edit-desc" +git bug ls status:open sort:edit-desc List closed bugs sorted by creation with flags: git bug ls --status closed --by creation