Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 952b99c

Browse files
authored
Merge pull request #52 from h4ckm310n/fix-go-extractor-help
[fix] Handle "--help" before parsing srcPath
2 parents 12d2681 + 3c0c2a3 commit 952b99c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎language/go/extractor/src/cli/helper.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func parseExtractorRunningParams(args []string) *extractionConf {
2424
usage()
2525
os.Exit(2)
2626
}
27+
if args[1] == "-h" || args[1] == "--help" {
28+
usage()
29+
os.Exit(0)
30+
}
2731

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /