Skip to content

Commit

Permalink
Merge pull request #141 from gofed/repeated-extension-flag
Browse files Browse the repository at this point in the history
Allow to repeat extenion flag instead of passing command separeted list
  • Loading branch information
ingvagabund committed Mar 2, 2018
2 parents 4ece600 + 2d68767 commit c30dccb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cmd/golist/golist.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
cli.BoolFlag{"tests", "Apply the listing options over tests", "", nil, false},
cli.BoolFlag{"show-main", "Including main files in listings", "", nil, false},
cli.BoolFlag{"to-install", "List all resources recognized as essential part of the Go project", "", nil, false},
cli.StringFlag{"with-extensions", "", "Include all files with the extensions in the recognized resources, e.g. *.proto,*.tmpl", "", nil, false},
cli.StringSliceFlag{"extension, e", nil, "Include all files with the extension in the recognized resources, e.g. .proto, .tmpl", "", false},
cli.BoolFlag{"json", "Output as JSON artefact", "", nil, false},
}

Expand Down Expand Up @@ -69,14 +69,7 @@ func main() {
ignore.Regexes = append(ignore.Regexes, regexp.MustCompile(dir))
}

var exts []string
for _, item := range strings.Split(c.String("extensions"), ",") {
if item != "" {
exts = append(exts, item)
}
}

collector := util.NewPackageInfoCollector(ignore, exts)
collector := util.NewPackageInfoCollector(ignore, c.StringSlice("extension"))
if err := collector.CollectPackageInfos(c.String("package-path")); err != nil {
return err

Expand Down

0 comments on commit c30dccb

Please sign in to comment.