diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 6f105fb3ee..aa07ec0263 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -1,5 +1,5 @@ -#: * `linkage` [`--test`] [`--reverse`] : -#: Checks the library links of an installed formula. +#: * `linkage` [`--test`] [`--reverse`] []: +#: Checks the library links of installed formulae. #: #: Only works on installed formulae. An error is raised if it is run on #: uninstalled formulae. @@ -9,6 +9,8 @@ #: #: If `--reverse` is passed, print the dylib followed by the binaries #: which link to it for each library the keg references. +#: +#: If are given, check linkage for only the specified brews. require "cache_store" require "linkage_checker" @@ -26,8 +28,13 @@ module Homebrew end CacheStoreDatabase.use(:linkage) do |db| - ARGV.kegs.each do |keg| - ohai "Checking #{keg.name} linkage" if ARGV.kegs.size > 1 + kegs = if ARGV.kegs.empty? + Formula.installed.collect(&:opt_or_installed_prefix_keg).reject(&:nil?) + else + ARGV.kegs + end + kegs.each do |keg| + ohai "Checking #{keg.name} linkage" if kegs.size > 1 result = LinkageChecker.new(keg, cache_db: db) diff --git a/docs/Manpage.md b/docs/Manpage.md index 4d01afabfc..8043eb9b0d 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -799,8 +799,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note If `--pry` is passed or HOMEBREW_PRY is set, pry will be used instead of irb. - * `linkage` [`--test`] [`--reverse`] `formula`: - Checks the library links of an installed formula. + * `linkage` [`--test`] [`--reverse`] [`formulae`]: + Checks the library links of installed formulae. Only works on installed formulae. An error is raised if it is run on uninstalled formulae. @@ -811,6 +811,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note If `--reverse` is passed, print the dylib followed by the binaries which link to it for each library the keg references. + If `formulae` are given, check linkage for only the specified brews. + * `man` [`--fail-if-changed`]: Generate Homebrew's manpages. diff --git a/manpages/brew.1 b/manpages/brew.1 index cf42d6818a..38fb534e60 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -738,8 +738,8 @@ Enter the interactive Homebrew Ruby shell\. If \fB\-\-examples\fR is passed, several examples will be shown\. If \fB\-\-pry\fR is passed or HOMEBREW_PRY is set, pry will be used instead of irb\. . .TP -\fBlinkage\fR [\fB\-\-test\fR] [\fB\-\-reverse\fR] \fIformula\fR -Checks the library links of an installed formula\. +\fBlinkage\fR [\fB\-\-test\fR] [\fB\-\-reverse\fR] [\fIformulae\fR] +Checks the library links of installed formulae\. . .IP Only works on installed formulae\. An error is raised if it is run on uninstalled formulae\. @@ -750,6 +750,9 @@ If \fB\-\-test\fR is passed, only display missing libraries and exit with a non\ .IP If \fB\-\-reverse\fR is passed, print the dylib followed by the binaries which link to it for each library the keg references\. . +.IP +If \fIformulae\fR are given, check linkage for only the specified brews\. +. .TP \fBman\fR [\fB\-\-fail\-if\-changed\fR] Generate Homebrew\'s manpages\.