Formula-Cookbook: avoid non-with options

Closes Homebrew/homebrew#42433.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
Ian Lancaster 2015-08-03 21:03:11 -04:00 committed by Dominyk Tiller
parent 150a9fe514
commit 65dbdccfc0

View File

@ -861,18 +861,12 @@ end
if build.without? "ham"
# works as you'd expect. True if `--without-ham` was given.
end
if build.include? "enable-ham"
# the deprecated style, only useful for options other than `with`/`without` style
end
```
Option names should be prefixed with one of the words `with`, `without`, `no`, or a verb in the imperative tense describing the action to be taken. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library should be named `--enable-shared` rather than `--shared`.
Option names should be prefixed with the words `with` or `without`. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library `--with-shared` rather than `--shared` or `--enable-shared`.
Note that options that arent ` build.with? ` or ` build.without? ` should be actively deprecated where possible. See [wget](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/wget.rb#L27-L31) for an example.
See the [graphviz](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/graphviz.rb) formula for an example.
## File level operations