expose url for ticket

This commit is contained in:
Olivier Tremblay 2016-05-31 12:41:46 -04:00
parent 5927b657f9
commit 9ef56fd692
No known key found for this signature in database
GPG key ID: 5C6658D49D6AE29F
3 changed files with 9 additions and 0 deletions

View file

@ -13,6 +13,10 @@ import (
) )
type listissue jkl.Issue type listissue jkl.Issue
func (l *listissue) URL() string {
i := jkl.Issue(*l)
return (&i).URL()
}
func (l *listissue) Color() string { func (l *listissue) Color() string {
if os.Getenv("JKLNOCOLOR") == "true" || !terminal.IsTerminal(int(os.Stdout.Fd())) { if os.Getenv("JKLNOCOLOR") == "true" || !terminal.IsTerminal(int(os.Stdout.Fd())) {

0
cmd/jklfs/jklfs Executable file → Normal file
View file

View file

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"log" "log"
"text/template" "text/template"
"os"
) )
type Search struct { type Search struct {
@ -76,6 +77,10 @@ type Issue struct {
Fields *Fields `json:"fields"` Fields *Fields `json:"fields"`
} }
func (i *Issue) URL() string {
return os.Getenv("JIRA_ROOT") + "browse/"+ i.Key
}
func (i *Issue) String() string { func (i *Issue) String() string {
var b = bytes.NewBuffer(nil) var b = bytes.NewBuffer(nil)
err := issueTmpl.Execute(b, i) err := issueTmpl.Execute(b, i)