Skip to content

Commit

Permalink
cli: add check config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Jun 24, 2024
1 parent 4cbc3cf commit b2f1cef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmds/hound/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func main() {
flagCase := flag.Bool("ignore-case", false, "")
flagStats := flag.Bool("show-stats", false, "")
flagGrep := flag.Bool("like-grep", false, "")
flagCheckCfg := flag.Bool("check-config", false, "")

flag.Parse()

Expand All @@ -113,6 +114,10 @@ func main() {
log.Panic(err)
}

if *flagCheckCfg {
return
}

res, repos, err := client.SearchAndLoadRepos(&cfg,
flag.Arg(0),
*flagRepos,
Expand Down
5 changes: 5 additions & 0 deletions cmds/houndd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func main() {
error_log = log.New(os.Stderr, "", log.LstdFlags)

flagConf := flag.String("conf", "config.json", "")
flagCheckConf := flag.Bool("check-conf", false, "")
flagAddr := flag.String("addr", ":6080", "")
flagDev := flag.Bool("dev", false, "")
flagVer := flag.Bool("version", false, "Display version and exit")
Expand All @@ -146,6 +147,10 @@ func main() {
panic(err)
}

if *flagCheckConf {
return
}

// Start the web server on a background routine.
ws := web.Start(&cfg, *flagAddr, *flagDev)

Expand Down

0 comments on commit b2f1cef

Please sign in to comment.