Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to repeat extenion flag instead of passing command separeted list #141

Merged
merged 1 commit into from
Mar 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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