diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-17 14:33:34 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-17 14:33:34 +0200 |
commit | 2965b70f4f462b3532bb380c5206e2d940f68c65 (patch) | |
tree | f612b5406f2173b981f54c1dfb12c45e1203dea1 /operations/label_change.go | |
parent | cc086ebae99dfeb936d9397f4e3eedf5d37a97b1 (diff) | |
download | git-bug-2965b70f4f462b3532bb380c5206e2d940f68c65.tar.gz |
commands: add a "label add" command to add new label to a bug
Diffstat (limited to 'operations/label_change.go')
-rw-r--r-- | operations/label_change.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/operations/label_change.go b/operations/label_change.go index 507651df..0ae4e032 100644 --- a/operations/label_change.go +++ b/operations/label_change.go @@ -167,3 +167,20 @@ type LabelChangeResult struct { Label bug.Label Status LabelChangeStatus } + +func (l LabelChangeResult) String() string { + switch l.Status { + case LabelChangeAdded: + return fmt.Sprintf("label %s added", l.Label) + case LabelChangeRemoved: + return fmt.Sprintf("label %s removed", l.Label) + case LabelChangeDuplicateInOp: + return fmt.Sprintf("label %s is a duplicate", l.Label) + case LabelChangeAlreadySet: + return fmt.Sprintf("label %s was already set", l.Label) + case LabelChangeDoesntExist: + return fmt.Sprintf("label %s doesn't exist on this bug", l.Label) + default: + panic(fmt.Sprintf("unknown label change status %v", l.Status)) + } +} |