aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorvince <vincetiu8@gmail.com>2020-07-21 11:41:46 +0800
committerMichael Muré <batolettre@gmail.com>2020-07-28 14:30:06 +0200
commit9436cf4b8983699ef7a164f4036686dd83d345d4 (patch)
tree4117b85ef19a3526cda1bbd36a5c90fb679f8db5 /commands
parent7dbcca84c7a0b6658463e3e54690b8860b662b6e (diff)
downloadgit-bug-9436cf4b8983699ef7a164f4036686dd83d345d4.tar.gz
Move args parsing out of repo cache
Diffstat (limited to 'commands')
-rw-r--r--commands/rm.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/commands/rm.go b/commands/rm.go
index 718fb4a3..800f16e1 100644
--- a/commands/rm.go
+++ b/commands/rm.go
@@ -1,6 +1,8 @@
package commands
import (
+ "errors"
+
"github.com/spf13/cobra"
)
@@ -25,7 +27,15 @@ func newRmCommand() *cobra.Command {
}
func runRm(env *Env, args []string) (err error) {
- err = env.backend.RemoveBug(args)
+ switch len(args) {
+ case 1:
+ err = env.backend.RemoveBug(args[0], "")
+ break
+ case 2:
+ err = env.backend.RemoveBug(args[0], args[1])
+ default:
+ return errors.New("invalid number of arguments for rm command")
+ }
if err != nil {
return