commands: ls now accept queries without quote

Michael Muré created

Change summary

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(-)

Detailed changes

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

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

doc/md/git-bug_ls.md 🔗

@@ -16,7 +16,7 @@ git-bug ls [<query>] [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