mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
cmd/deps: add --os
and --arch
Signed-off-by: Michael Cho <michael@michaelcho.dev>
This commit is contained in:
parent
8810b7f041
commit
77a16c2e15
@ -66,6 +66,10 @@ module Homebrew
|
||||
"debugging the `--installed`/`--eval-all` display mode."
|
||||
switch "--HEAD",
|
||||
description: "Show dependencies for HEAD version instead of stable version."
|
||||
flag "--os=",
|
||||
description: "Show dependencies for the given operating system."
|
||||
flag "--arch=",
|
||||
description: "Show dependencies for the given CPU architecture."
|
||||
switch "--formula", "--formulae",
|
||||
description: "Treat all named arguments as formulae."
|
||||
switch "--cask", "--casks",
|
||||
@ -82,10 +86,15 @@ module Homebrew
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
raise UsageError, "`brew deps --os=all` is not supported" if args.os == "all"
|
||||
raise UsageError, "`brew deps --arch=all` is not supported" if args.arch == "all"
|
||||
|
||||
os, arch = T.must(args.os_arch_combinations.first)
|
||||
all = args.eval_all?
|
||||
|
||||
Formulary.enable_factory_cache!
|
||||
|
||||
SimulateSystem.with(os:, arch:) do
|
||||
recursive = !args.direct?
|
||||
installed = args.installed? || dependents(args.named.to_formulae_and_casks).all?(&:any_version_installed?)
|
||||
|
||||
@ -97,7 +106,9 @@ module Homebrew
|
||||
!args.include_test? &&
|
||||
!args.include_optional? &&
|
||||
!args.skip_recommended? &&
|
||||
!args.missing?
|
||||
!args.missing? &&
|
||||
args.os.nil? &&
|
||||
args.arch.nil?
|
||||
|
||||
if args.tree? || args.graph?
|
||||
dependents = if args.named.present?
|
||||
@ -162,6 +173,7 @@ module Homebrew
|
||||
all_deps.sort! unless args.topological?
|
||||
puts all_deps
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user