From 4265913001f052f1780328cd285b9da20749bf1e Mon Sep 17 00:00:00 2001 From: Cory Bennett Date: Mon, 14 Sep 2015 12:31:53 -0700 Subject: [PATCH] fix "edit" default option, change how defaults are dealt with for filters --- Makefile | 2 +- jira/main.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e6c1757e..5c85c579 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ all: done fmt: - gofmt -s -w jira && git commit -a -m "gofmt" + gofmt -s -w jira install: export GOBIN=~/bin && ${MAKE} build diff --git a/jira/main.go b/jira/main.go index 493e98f9..35b3611c 100644 --- a/jira/main.go +++ b/jira/main.go @@ -140,8 +140,6 @@ Command Options: defaults := map[string]interface{}{ "user": user, - "issuetype": "Bug", - "watcher": user, "queryfields": defaultQueryFields, "directory": fmt.Sprintf("%s/.jira.d/templates", home), "sort": defaultSort, @@ -228,15 +226,19 @@ Command Options: log.Debug("opts: %s", opts) setEditing := func(dflt bool) { + log.Debug("Default Editing: %t", dflt) if dflt { if val, ok := opts["noedit"].(bool); ok && val { + log.Debug("Setting edit = false") opts["edit"] = false } else { + log.Debug("Setting edit = true") opts["edit"] = true } } else { - if val, ok := opts["edit"].(bool); ok && !val { - opts["edit"] = false + if _, ok := opts["edit"].(bool); !ok { + log.Debug("Setting edit = %t", dflt) + opts["edit"] = dflt } } } @@ -257,9 +259,7 @@ Command Options: var data interface{} if data, err = c.FindIssues(); err == nil { issues := data.(map[string]interface{})["issues"].([]interface{}) - log.Notice("Found Issues: %d", len(issues)) for _, issue := range issues { - log.Notice("Issue: %s", issue.(map[string]interface{})["key"]) if err = c.CmdEdit(issue.(map[string]interface{})["key"].(string)); err != nil { switch err.(type) { case cli.NoChangesFound: