Skip to content

Commit 1289ea5

Browse files
committed
feat: 升级maven-crawler & 优化command帮助信息
1 parent 46483a9 commit 1289ea5

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

cmd/track.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ var (
2727

2828
func init() {
2929

30-
trackCmd.Flags().StringVarP(&groupId, "groupId", "g", "", "Group ID for track")
31-
trackCmd.Flags().StringVarP(&artifactId, "artifactId", "a", "", "Artifact ID for track")
32-
trackCmd.Flags().StringVarP(&class, "class", "c", "", "class for track, example: org.springframework.web.servlet.mvc.method.RequestMappingInfo")
33-
trackCmd.Flags().StringVarP(&output, "output", "o", "", "result output directory, default current directory")
30+
trackCmd.Flags().StringVarP(&groupId, "groupId", "g", "", "Group ID for track, example: org.apache.dubbo")
31+
trackCmd.Flags().StringVarP(&artifactId, "artifactId", "a", "", "Artifact ID for track, example: dubbo")
32+
trackCmd.Flags().StringVarP(&class, "class", "c", "", "Class for track, example: org.springframework.web.servlet.mvc.method.RequestMappingInfo")
33+
trackCmd.Flags().StringVarP(&output, "output", "o", "", "result output directory, default ./output")
3434

3535
rootCmd.AddCommand(trackCmd)
3636
}
@@ -40,6 +40,11 @@ var trackCmd = &cobra.Command{
4040
Short: "track for class",
4141
Long: ``,
4242
RunE: func(cmd *cobra.Command, args []string) error {
43+
44+
if output == "" {
45+
output = "./output"
46+
}
47+
4348
report, err := track.Track(cmd.Context(), groupId, artifactId, class)
4449
if err != nil {
4550
return err

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ require (
66
github.com/compression-algorithm-research-lab/go-unzip v0.0.0-20230602073303-1217108c498f
77
github.com/fatih/color v1.15.0
88
github.com/ivanpirog/coloredcobra v1.0.1
9-
github.com/scagogogo/maven-crawler v0.0.0-20230619030815-61998034bc24
9+
github.com/scagogogo/maven-crawler v0.0.0-20230627145717-417d160dbb16
1010
github.com/scagogogo/mvn-sdk v0.0.0-20230620031453-2d99a2094f36
11+
github.com/scagogogo/versions v0.0.0-20230616073442-f7ffd332b5e8
1112
github.com/spf13/cobra v1.7.0
1213
github.com/stretchr/testify v1.8.4
1314
)
@@ -46,7 +47,6 @@ require (
4647
github.com/pkg/errors v0.9.1 // indirect
4748
github.com/pmezard/go-difflib v1.0.0 // indirect
4849
github.com/scagogogo/maven-pom-xml-render v0.0.0-20230522042741-86dd7c7d0e1f // indirect
49-
github.com/scagogogo/versions v0.0.0-20230616073442-f7ffd332b5e8 // indirect
5050
github.com/spf13/afero v1.9.5 // indirect
5151
github.com/spf13/cast v1.5.1 // indirect
5252
github.com/spf13/jwalterweatherman v1.1.0 // indirect

go.sum

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ github.com/golang-infrastructure/go-project-root-directory v0.0.1 h1:oYMUpcRV1Wp
101101
github.com/golang-infrastructure/go-project-root-directory v0.0.1/go.mod h1:d3Md9d69xR8kqhGDqI2Du2nlyKJGZssSLGrF5i5bMtQ=
102102
github.com/golang-infrastructure/go-reflect-utils v0.0.0-20221130143747-965ef2eb09c3 h1:jJ7AdpNdLQudsx1hiXY9iwmauHARV4/UB52KnBh9Se0=
103103
github.com/golang-infrastructure/go-reflect-utils v0.0.0-20221130143747-965ef2eb09c3/go.mod h1:zqXYxqOBa1mL2ilBK6PuH/Wb/Iego7en6XhiKWdZQHI=
104+
github.com/golang-infrastructure/go-shuffle v0.0.2 h1:48d6qX3fYDUyTSMnz04lZpa4V6d4X1KZBj+F0FQYMqg=
104105
github.com/golang-infrastructure/go-stack v0.0.2 h1:1F+F4/s2YlAW9NI8zc4jl90WrqLlXsWfCstBRpPvVl4=
105106
github.com/golang-infrastructure/go-stack v0.0.2/go.mod h1:m7RdZjsmlvHogbsiovh1uxvxVhwzJdNsrYh1BxdcFrQ=
106107
github.com/golang-infrastructure/go-tuple v0.0.0-20221215155811-4ed54fe7d579 h1:pQV2/ichhyLoR3aJSNXByuxtdPM2y229Rq5x9DGl5OU=
@@ -223,8 +224,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
223224
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
224225
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
225226
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
226-
github.com/scagogogo/maven-crawler v0.0.0-20230619030815-61998034bc24 h1:ehS6/YvWTP5yy48p0RuRro5GrKgSo496NBANGrswAnI=
227-
github.com/scagogogo/maven-crawler v0.0.0-20230619030815-61998034bc24/go.mod h1:r4G8xikfY7drMQ0CibKYnmdrqPDiCAfFVxlNDpcRgUU=
227+
github.com/scagogogo/maven-crawler v0.0.0-20230627145717-417d160dbb16 h1:01aS887yNvhlxt3EGBh6NjlH91KP9FL+EFtT/UK9wtE=
228+
github.com/scagogogo/maven-crawler v0.0.0-20230627145717-417d160dbb16/go.mod h1:r4G8xikfY7drMQ0CibKYnmdrqPDiCAfFVxlNDpcRgUU=
228229
github.com/scagogogo/maven-pom-xml-render v0.0.0-20230522042741-86dd7c7d0e1f h1:KRD5A/eUk8P7AaDl+loj8TrO0NnQdfDJY+gyPXYzarw=
229230
github.com/scagogogo/maven-pom-xml-render v0.0.0-20230522042741-86dd7c7d0e1f/go.mod h1:hPsCPj6i7WOSpT21xt66RUyDotyU0gkjbcJZe33YWe0=
230231
github.com/scagogogo/mvn-sdk v0.0.0-20230620031453-2d99a2094f36 h1:pcqB45gzNdDeMb+FK/cQjtv4sS4OTWVAHw8qZn/IPpk=

0 commit comments

Comments
 (0)