fix(comments): preserve unquoted multi-word text (#5192)
This commit is contained in:
parent
bfdc54b06a
commit
6356dce01b
4 changed files with 5 additions and 5 deletions
|
|
@ -193,7 +193,7 @@ func TestProxiedServerComment(t *testing.T) {
|
|||
p := newSharedProxiedProject(t, bd, "aj")
|
||||
issue := bdProxiedCreate(t, bd, p.dir, "Add JSON")
|
||||
|
||||
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "comments", "add", issue.ID, "add json body", "--json")
|
||||
stdout, stderr, err := bdProxiedRunBuffers(t, bd, p.dir, "comments", "add", issue.ID, "add", "json", "body", "--json")
|
||||
if err != nil {
|
||||
t.Fatalf("comments add --json failed: %v\nstderr:\n%s", err, stderr)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ See: bd comments --help`)
|
|||
}
|
||||
|
||||
var commentsAddCmd = &cobra.Command{
|
||||
Use: "add [issue-id] [text]",
|
||||
Use: "add [issue-id] [text...]",
|
||||
Short: "Add a comment to an issue",
|
||||
Long: `Add a comment to an issue.
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ Examples:
|
|||
} else if len(args) < 2 {
|
||||
return HandleErrorRespectJSON("comment text required (use -f to read from file)")
|
||||
} else {
|
||||
commentText = args[1]
|
||||
commentText = strings.Join(args[1:], " ")
|
||||
}
|
||||
|
||||
if strings.TrimSpace(commentText) == "" {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ func TestEmbeddedCommentsCLI(t *testing.T) {
|
|||
|
||||
t.Run("comments_add_json", func(t *testing.T) {
|
||||
issue := bdCreate(t, bd, dir, "JSON comment", "--type", "task")
|
||||
cmd := exec.Command(bd, "comments", "add", issue.ID, "JSON comment text", "--json")
|
||||
cmd := exec.Command(bd, "comments", "add", issue.ID, "JSON", "comment", "text", "--json")
|
||||
cmd.Dir = dir
|
||||
cmd.Env = bdEnv(dir)
|
||||
stdout, stderr, err := runCommandBuffers(t, cmd)
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ func runCommentsAddProxiedServer(cmd *cobra.Command, ctx context.Context, args [
|
|||
} else if len(args) < 2 {
|
||||
return HandleErrorRespectJSON("comment text required (use -f to read from file)")
|
||||
} else {
|
||||
commentText = args[1]
|
||||
commentText = strings.Join(args[1:], " ")
|
||||
}
|
||||
|
||||
if strings.TrimSpace(commentText) == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue