Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: read config from stdin #802

Merged
merged 1 commit into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/tegola/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var (

func init() {
// root
RootCmd.PersistentFlags().StringVar(&configFile, "config", "config.toml", "path to config file")
RootCmd.PersistentFlags().StringVar(&configFile, "config", "config.toml",
"path or http url to a config file, or \"-\" for stdin")

// server
serverCmd.Flags().StringVarP(&serverPort, "port", "p", ":8080", "port to bind tile server to")
Expand Down
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ func Load(location string) (conf Config, err error) {

// set the reader to the response body
reader = res.Body
} else if location == "-" {
log.Infof("loading local config from stdin")
reader = os.Stdin
} else {
log.Infof("loading local config (%v)", location)

Expand Down