You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/web.go
+14-16Lines changed: 14 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -3,41 +3,39 @@ package cmd
3
3
import (
4
4
"fmt"
5
5
6
-
"os"
7
-
"strconv"
8
-
9
-
"github.com/praqma/git-phlow/phlow"
10
6
"github.com/spf13/cobra"
11
7
12
8
"github.com/praqma/git-phlow/cmd/cmdperm"
13
9
"github.com/praqma/git-phlow/ui"
10
+
"github.com/praqma/git-phlow/options"
11
+
"github.com/praqma/git-phlow/phlow"
14
12
)
15
13
16
14
// webCmd represents the web command
17
15
varwebCmd=&cobra.Command{
18
16
Use: "web [issue]",
19
-
Short: "open your issues on github",
17
+
Short: "open your issues in the browser",
20
18
Long: fmt.Sprintf(`
21
-
%s opens a GitHub issue or GitHub issue list based on it's arguments.
19
+
%s opens an issue in your default browser
20
+
21
+
The command uses a targetet configuration to figure out where you have your issues hosted e.g. Github or jira.
22
+
Use the 'issue-web' field in the configuration to point to the url of the issue management system.
23
+
24
+
The command can take an argument of the issue you want to use.
22
25
If no argument is given, it tries to find the issue of the currently checked out branch, if that fails it simply opens the GitHub issue list in your default browser.
23
26
`, ui.Format.Bold("web")),
24
27
PreRun: func(cmd*cobra.Command, args []string) {
25
28
cmdperm.RequiredCurDirRepository()
26
29
},
27
30
Run: func(cmd*cobra.Command, args []string) {
28
-
iflen(args) >0 {
29
-
ifval, err:=strconv.Atoi(args[0]); err==nil {
30
-
phlow.Web(val)
31
-
} else {
32
-
fmt.Println("Argument must be a number")
33
-
os.Exit(0)
34
-
}
35
-
} else {
36
-
phlow.Web(-1)
37
-
}
31
+
32
+
phlow.WebCaller(args)
33
+
38
34
},
39
35
}
40
36
41
37
funcinit() {
42
38
RootCmd.AddCommand(webCmd)
39
+
40
+
webCmd.Flags().StringVarP(&options.GlobalFlagTarget, "target", "t", "", "the name of the INI block in your .phlow files")
0 commit comments