fix: handle global help cleanly
This commit is contained in:
parent
d4b8e38e97
commit
d48e5a53cc
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,6 @@
|
||||
bin/
|
||||
dist/
|
||||
notioncrawl
|
||||
/notioncrawl
|
||||
*.db
|
||||
*.db-*
|
||||
*.log
|
||||
|
||||
@ -26,6 +26,10 @@ func main() {
|
||||
}
|
||||
|
||||
func run(ctx context.Context, args []string, stdout, stderr io.Writer) error {
|
||||
if len(args) == 0 || args[0] == "help" || args[0] == "--help" || args[0] == "-h" {
|
||||
printHelp(stdout)
|
||||
return nil
|
||||
}
|
||||
global := flag.NewFlagSet("notioncrawl", flag.ContinueOnError)
|
||||
global.SetOutput(stderr)
|
||||
configPath := global.String("config", "", "config file path")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user