Skip to content

Commit

Permalink
fix unsafe casting for --quiet flag
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed May 10, 2017
1 parent 03d8633 commit 6f29f43
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (c *Cli) CmdWorklog(action string, issue string) error {

if resp.StatusCode == 201 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
return nil
Expand Down Expand Up @@ -210,7 +210,7 @@ func (c *Cli) CmdEdit(issue string) error {

if resp.StatusCode == 204 {
c.Browse(issueData["key"].(string))
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issueData["key"], c.endpoint, issueData["key"])
}
return nil
Expand Down Expand Up @@ -416,7 +416,7 @@ func (c *Cli) CmdCreate() error {
"issue": key,
"link": link,
})
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s\n", key, link)
}
return nil
Expand Down Expand Up @@ -506,7 +506,7 @@ func (c *Cli) CmdSubtask(issue string) error {
"issue": key,
"link": link,
})
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s\n", key, link)
}
return nil
Expand Down Expand Up @@ -562,7 +562,7 @@ func (c *Cli) CmdIssueLink(inwardIssue string, issueLinkTypeName string, outward
}
if resp.StatusCode == 201 {
c.Browse(inwardIssue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", inwardIssue, c.endpoint, inwardIssue)
}
} else {
Expand Down Expand Up @@ -606,7 +606,7 @@ func (c *Cli) CmdBlocks(blocker string, issue string) error {
}
if resp.StatusCode == 201 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
} else {
Expand Down Expand Up @@ -651,7 +651,7 @@ func (c *Cli) CmdDups(duplicate string, issue string) error {
}
if resp.StatusCode == 201 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
} else {
Expand Down Expand Up @@ -699,7 +699,7 @@ func (c *Cli) CmdWatch(issue string, watcher string, remove bool) error {
}
if resp.StatusCode == 204 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
} else {
Expand Down Expand Up @@ -743,7 +743,7 @@ func (c *Cli) CmdVote(issue string, up bool) error {
}
if resp.StatusCode == 204 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
} else {
Expand All @@ -766,7 +766,7 @@ func (c *Cli) CmdRankAfter(issue, after string) error {
if err != nil {
return nil
}
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
return nil
Expand All @@ -778,7 +778,7 @@ func (c *Cli) CmdRankBefore(issue, before string) error {
if err != nil {
return nil
}
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
return nil
Expand Down Expand Up @@ -829,7 +829,7 @@ func (c *Cli) CmdTransition(issue string, trans string) error {
}
if resp.StatusCode == 204 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
} else {
Expand Down Expand Up @@ -899,7 +899,7 @@ func (c *Cli) CmdComment(issue string) error {

if resp.StatusCode == 201 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
return nil
Expand Down Expand Up @@ -959,7 +959,7 @@ func (c *Cli) CmdComponent(action string, project string, name string, desc stri
return err
}
if resp.StatusCode == 201 {
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s\n", project, name)
}
} else {
Expand Down Expand Up @@ -994,7 +994,7 @@ func (c *Cli) CmdLabels(action string, issue string, labels []string) error {

if resp.StatusCode == 204 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
return nil
Expand Down Expand Up @@ -1069,7 +1069,7 @@ func (c *Cli) CmdAssign(issue string, user string) error {
}
if resp.StatusCode == 204 {
c.Browse(issue)
if !c.opts["quiet"].(bool) {
if !c.GetOptBool("quiet", false) {
fmt.Printf("OK %s %s/browse/%s\n", issue, c.endpoint, issue)
}
} else {
Expand Down

0 comments on commit 6f29f43

Please sign in to comment.