diff options
author | vince <vincetiu8@gmail.com> | 2020-07-21 11:41:46 +0800 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-07-28 14:30:06 +0200 |
commit | 9436cf4b8983699ef7a164f4036686dd83d345d4 (patch) | |
tree | 4117b85ef19a3526cda1bbd36a5c90fb679f8db5 /commands/rm.go | |
parent | 7dbcca84c7a0b6658463e3e54690b8860b662b6e (diff) | |
download | git-bug-9436cf4b8983699ef7a164f4036686dd83d345d4.tar.gz |
Move args parsing out of repo cache
Diffstat (limited to 'commands/rm.go')
-rw-r--r-- | commands/rm.go | 12 |
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 |