Skip to content

Commit

Permalink
fix: read dav from env as fallback
Browse files Browse the repository at this point in the history
Signed-off-by: 117503445 <[email protected]>
  • Loading branch information
117503445 committed Feb 19, 2024
1 parent bb47d59 commit ecaf77f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func Execute() error {

func init() {
rootCmd.PersistentFlags().StringVar(&dav, "dav", DEFAULT_DAV_CONFIG, "")
if dav == DEFAULT_DAV_CONFIG {
if envDav := os.Getenv("dav"); envDav != "" {
dav = envDav
}
}
rootCmd.PersistentFlags().StringVarP(&addr, "address", "a", "0.0.0.0", "address to listen")
rootCmd.PersistentFlags().StringVarP(&port, "port", "p", "80", "port to listen")
}

0 comments on commit ecaf77f

Please sign in to comment.