Skip to content

Commit

Permalink
Merge pull request #52 from h4ckm310n/fix-go-extractor-help
Browse files Browse the repository at this point in the history
[fix] Handle "--help" before parsing srcPath
  • Loading branch information
lonrun authored Jun 3, 2024
2 parents 12d2681 + 3c0c2a3 commit 952b99c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions language/go/extractor/src/cli/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func parseExtractorRunningParams(args []string) *extractionConf {
usage()
os.Exit(2)
}
if args[1] == "-h" || args[1] == "--help" {
usage()
os.Exit(0)
}

configArgs := strings.Split(strings.Join(args[1:], " "), " ")
srcPath, err := filepath.Abs(configArgs[len(configArgs)-1])
Expand All @@ -42,9 +46,6 @@ func parseExtractorRunningParams(args []string) *extractionConf {
for i := 0; i < len(configArgs)-1 && strings.HasPrefix(configArgs[i], "-"); i++ {
arg := configArgs[i]
switch arg {
case "-h", "--help":
usage()
os.Exit(0)
case "-exconfig", "-ex":
handleExtractionArg(configArgs, &i, extractionConfig)
case "-o", "-output", "-dbpath":
Expand Down

0 comments on commit 952b99c

Please sign in to comment.