aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/add.go6
-rw-r--r--commands/comment_add.go3
-rw-r--r--commands/label_add.go3
-rw-r--r--commands/label_rm.go3
-rw-r--r--commands/title_edit.go3
5 files changed, 13 insertions, 5 deletions
diff --git a/commands/add.go b/commands/add.go
index 17fbbc93..ad3b164b 100644
--- a/commands/add.go
+++ b/commands/add.go
@@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"
"github.com/MichaelMure/git-bug/input"
+ "github.com/MichaelMure/git-bug/util/text"
)
type addOptions struct {
@@ -60,7 +61,10 @@ func runAdd(env *Env, opts addOptions) error {
}
}
- b, _, err := env.backend.NewBug(opts.title, opts.message)
+ b, _, err := env.backend.NewBug(
+ text.CleanupOneLine(opts.title),
+ text.Cleanup(opts.message),
+ )
if err != nil {
return err
}
diff --git a/commands/comment_add.go b/commands/comment_add.go
index 6caf4943..438e983a 100644
--- a/commands/comment_add.go
+++ b/commands/comment_add.go
@@ -5,6 +5,7 @@ import (
_select "github.com/MichaelMure/git-bug/commands/select"
"github.com/MichaelMure/git-bug/input"
+ "github.com/MichaelMure/git-bug/util/text"
)
type commentAddOptions struct {
@@ -62,7 +63,7 @@ func runCommentAdd(env *Env, opts commentAddOptions, args []string) error {
}
}
- _, err = b.AddComment(opts.message)
+ _, err = b.AddComment(text.Cleanup(opts.message))
if err != nil {
return err
}
diff --git a/commands/label_add.go b/commands/label_add.go
index ce971f04..30c0d77f 100644
--- a/commands/label_add.go
+++ b/commands/label_add.go
@@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"
_select "github.com/MichaelMure/git-bug/commands/select"
+ "github.com/MichaelMure/git-bug/util/text"
)
func newLabelAddCommand() *cobra.Command {
@@ -30,7 +31,7 @@ func runLabelAdd(env *Env, args []string) error {
added := args
- changes, _, err := b.ChangeLabels(added, nil)
+ changes, _, err := b.ChangeLabels(text.CleanupOneLineArray(added), nil)
for _, change := range changes {
env.out.Println(change)
diff --git a/commands/label_rm.go b/commands/label_rm.go
index f59ec02d..9fb3e096 100644
--- a/commands/label_rm.go
+++ b/commands/label_rm.go
@@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"
_select "github.com/MichaelMure/git-bug/commands/select"
+ "github.com/MichaelMure/git-bug/util/text"
)
func newLabelRmCommand() *cobra.Command {
@@ -30,7 +31,7 @@ func runLabelRm(env *Env, args []string) error {
removed := args
- changes, _, err := b.ChangeLabels(nil, removed)
+ changes, _, err := b.ChangeLabels(nil, text.CleanupOneLineArray(removed))
for _, change := range changes {
env.out.Println(change)
diff --git a/commands/title_edit.go b/commands/title_edit.go
index 3750f2cc..455c9384 100644
--- a/commands/title_edit.go
+++ b/commands/title_edit.go
@@ -5,6 +5,7 @@ import (
_select "github.com/MichaelMure/git-bug/commands/select"
"github.com/MichaelMure/git-bug/input"
+ "github.com/MichaelMure/git-bug/util/text"
)
type titleEditOptions struct {
@@ -58,7 +59,7 @@ func runTitleEdit(env *Env, opts titleEditOptions, args []string) error {
env.err.Println("No change, aborting.")
}
- _, err = b.SetTitle(opts.title)
+ _, err = b.SetTitle(text.CleanupOneLine(opts.title))
if err != nil {
return err
}