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

Add a semantic CLI option for no config file #2689

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -272,9 +272,13 @@ $ puma -C /path/to/config

If no configuration file is specified, Puma will look for a configuration file at `config/puma.rb`. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` or the `RAILS_ENV` environment variables, Puma first looks for configuration at `config/puma/<environment_name>.rb`, and then falls back to `config/puma.rb`.

If you want to prevent Puma from looking for a configuration file in those locations, provide a dash as the argument to the `-C` (or `--config`) flag:
If you want to prevent Puma from looking for a configuration file in those locations, include the `--no-config` flag:

```
$ puma -C --no-config

# or

$ puma -C "-"
```

Expand Down
5 changes: 5 additions & 0 deletions lib/puma/cli.rb
Expand Up @@ -112,6 +112,11 @@ def setup_options
file_config.load arg
end

# Identical to supplying --config "-", but more semantic
o.on "--no-config", "Prevent Puma from searching for a config file" do |arg|
file_config.load "-"
end

o.on "--control-url URL", "The bind url to use for the control server. Use 'auto' to use temp unix server" do |arg|
configure_control_url(arg)
end
Expand Down