Skip to content

Commit 9a38ca7

Browse files
committed
close #69 list issues
1 parent 6f92806 commit 9a38ca7

26 files changed

+525
-248
lines changed

cmd/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55

66
"fmt"
77

8-
"github.com/spf13/cobra"
98
"github.com/praqma/git-phlow/ui"
9+
"github.com/spf13/cobra"
1010
)
1111

1212
// agentCmd represents the agent command

cmd/auth.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
package cmd
22

33
import (
4+
"fmt"
45
"github.com/praqma/git-phlow/phlow"
6+
"github.com/praqma/git-phlow/ui"
57
"github.com/spf13/cobra"
68
)
79

810
//enable command
911
var authCmd = &cobra.Command{
1012
Use: "auth",
1113
Short: "authenticate with github",
12-
Long: `
13-
[auth] is needed to enable 'workon' with issues management.
14+
Long: fmt.Sprintf(`
15+
%s is needed to enable 'workon' with issues management.
1416
Auth will prompt your for a github username and password,
1517
which will generate a token we use for your github account.
1618
Don't worry the token does not create admin access,
17-
only acces to manage issues for public repositories'`,
19+
only acces to manage issues for public repositories'`, ui.Bold("auth")),
1820
Run: func(cmd *cobra.Command, args []string) {
19-
2021
phlow.Auth()
21-
2222
},
2323
}
2424

cmd/clean.go renamed to cmd/cleanup.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@ import (
77
"github.com/praqma/git-phlow/options"
88
"github.com/praqma/git-phlow/phlow"
99
"github.com/praqma/git-phlow/plugins"
10-
"github.com/spf13/cobra"
1110
"github.com/praqma/git-phlow/ui"
11+
"github.com/spf13/cobra"
1212
)
1313

1414
// purgeCmd represents the purge command
1515
var cleanCmd = &cobra.Command{
16-
Use: "clean",
17-
Short: "clean removes all delivered branches",
16+
Use: "cleanup",
17+
Short: "cleanup removes all delivered branches",
1818
Long: fmt.Sprintf(`
1919
%s removes all branches prefixed with 'delivered/'.
2020
It deletes safely by running 'git branch -d'. By default, both local and remote branches are deleted.
2121
`, ui.Bold("phlow clean")),
2222
Run: func(cmd *cobra.Command, args []string) {
23-
24-
defaultBranch, _ := plugins.GetDefaultBranch(plugins.RepoURL)
23+
defaultBranch, _ := plugins.GitHub.Branch.Default()
2524
remote := githandler.ConfigBranchRemote(defaultBranch)
2625

2726
phlow.Clean(remote)

cmd/deliver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"github.com/praqma/git-phlow/options"
88
"github.com/praqma/git-phlow/phlow"
99
"github.com/praqma/git-phlow/plugins"
10-
"github.com/spf13/cobra"
1110
"github.com/praqma/git-phlow/ui"
11+
"github.com/spf13/cobra"
1212
)
1313

1414
// deliverCmd represents the deliver command
@@ -27,7 +27,7 @@ and pushed to your "remote default branch" and prefixed with "/delivered"
2727
`,
2828
Run: func(cmd *cobra.Command, args []string) {
2929

30-
defaultBranch, _ := plugins.GetDefaultBranch(plugins.RepoURL)
30+
defaultBranch, _ := plugins.GitHub.Branch.Default()
3131

3232
//Run tests before deliver
3333
if len(args) > 0 {

cmd/integrate.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55

66
"github.com/praqma/git-phlow/phlow"
77
"github.com/praqma/git-phlow/plugins"
8-
"github.com/spf13/cobra"
98
"github.com/praqma/git-phlow/ui"
9+
"github.com/spf13/cobra"
1010
)
1111

1212
// integrateCmd represents the integrate command
@@ -19,7 +19,10 @@ with your default branch and pushed to the remote.
1919
`, ui.Bold("integrate")),
2020
Run: func(cmd *cobra.Command, args []string) {
2121

22-
defaultBranch, _ := plugins.GetDefaultBranch(plugins.RepoURL)
22+
defaultBranch, err := plugins.GitHub.Branch.Default()
23+
if err != nil {
24+
fmt.Println(err)
25+
}
2326
phlow.LocalDeliver(defaultBranch)
2427
},
2528
}

cmd/issues.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cmd
2+
3+
import (
4+
"github.com/praqma/git-phlow/options"
5+
"github.com/praqma/git-phlow/phlow"
6+
"github.com/spf13/cobra"
7+
)
8+
9+
// issueCmd represents the issue command
10+
var issueCmd = &cobra.Command{
11+
Use: "issues",
12+
Short: "list GitHub issues",
13+
Long: `
14+
List all the open issues on GitHub with it's ID. Helps you locate what needs to be worked on
15+
`,
16+
Run: func(cmd *cobra.Command, args []string) {
17+
phlow.IssueList()
18+
},
19+
}
20+
21+
func init() {
22+
RootCmd.AddCommand(issueCmd)
23+
24+
issueCmd.Flags().BoolVarP(&options.GlobalFlagMine, "mine", "m", false, "list only issues assigned to you")
25+
}

cmd/mkalias.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55

66
"github.com/praqma/git-phlow/phlow"
7-
"github.com/spf13/cobra"
87
"github.com/praqma/git-phlow/ui"
8+
"github.com/spf13/cobra"
99
)
1010

1111
// mkaliasCmd represents the mkalias command

cmd/upnext.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"github.com/praqma/git-phlow/options"
88
"github.com/praqma/git-phlow/phlow"
99
"github.com/praqma/git-phlow/plugins"
10-
"github.com/spf13/cobra"
1110
"github.com/praqma/git-phlow/ui"
11+
"github.com/spf13/cobra"
1212
)
1313

1414
// upNextCmd represents the upnext command
@@ -22,7 +22,7 @@ The branch created first, is the branch thats up next.
2222

2323
Run: func(cmd *cobra.Command, args []string) {
2424

25-
defaultBranch, _ := plugins.GetDefaultBranch(plugins.RepoURL)
25+
defaultBranch, _ := plugins.GitHub.Branch.Default()
2626
remote := githandler.ConfigBranchRemote(defaultBranch)
2727

2828
phlow.UpNext(remote)

cmd/workon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"strconv"
77

88
"github.com/praqma/git-phlow/phlow"
9-
"github.com/spf13/cobra"
109
"github.com/praqma/git-phlow/ui"
10+
"github.com/spf13/cobra"
1111
)
1212

1313
// workonCmd represents the workon command

executor/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
//VerboseOutput ...
1313
//prints the commands being run by the program
1414
func VerboseOutput(application string, argv ...string) {
15-
fmt.Print(application)
15+
fmt.Print("Exec: ", application)
1616
for _, arg := range argv {
1717
fmt.Print(" " + arg)
1818
}

0 commit comments

Comments
 (0)