Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit 88d6b21

Browse files
author
Pavan Kumar
committed
log which parse command was used
1 parent b85af0a commit 88d6b21

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

main.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ func main() {
100100
}
101101
e.ParseAPIClient = apiClient
102102

103-
message, err := checkIfSupported(&e, version)
103+
var rootCmd *cobra.Command
104+
switch e.Type {
105+
case legacyParseFormat, parseFormat:
106+
rootCmd = parseRootCmd(&e)
107+
}
108+
109+
message, err := checkIfSupported(&e, version, os.Args[1:]...)
104110
if err != nil {
105111
fmt.Fprintln(e.Err, err)
106112
os.Exit(1)
@@ -109,11 +115,6 @@ func main() {
109115
fmt.Fprintln(e.Err, message)
110116
}
111117

112-
var rootCmd *cobra.Command
113-
switch e.Type {
114-
case legacyParseFormat, parseFormat:
115-
rootCmd = parseRootCmd(&e)
116-
}
117118
if err := rootCmd.Execute(); err != nil {
118119
// Error is already printed in Execute()
119120
os.Exit(1)

utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ func getHostFromURL(urlStr, email string) (string, error) {
112112
return server, nil
113113
}
114114

115-
func checkIfSupported(e *env, version string) (string, error) {
115+
func checkIfSupported(e *env, version string, args ...string) (string, error) {
116116
v := make(url.Values)
117117
v.Set("version", version)
118+
v.Set("other", strings.Join(args, " "))
118119
req := &http.Request{
119120
Method: "GET",
120121
URL: &url.URL{Path: "supported", RawQuery: v.Encode()},

0 commit comments

Comments
 (0)