Skip to content

Commit

Permalink
Add a semantic CLI option for no config file (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobherrington committed Sep 5, 2021
1 parent 3c5d12d commit 3b2eb69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 3b2eb69

Please sign in to comment.