Can a Homebrew formula accept options with values for `install`, like `--foo=bar`?

人走茶凉 提交于 2019-12-21 20:33:55

问题


I know that a Homebrew formula can check Boolean options (--with-foo, --without-bar) passed to brew install.

Can brew install accept options with values, like --foo=/path/to/bar?


回答1:


It turns out you can use ARGV.value.

e.g.

option "with-bin-path=", "Path for binary path"
# ...
binpath = ARGV.value("with-bin-path")

See https://github.com/Homebrew/brew/issues/1803



来源:https://stackoverflow.com/questions/22564690/can-a-homebrew-formula-accept-options-with-values-for-install-like-foo-bar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!