mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Port Homebrew::Cmd::Missing
This commit is contained in:
parent
0cb608a80c
commit
a43224cb4a
@ -1,17 +1,15 @@
|
|||||||
# typed: true
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "abstract_command"
|
||||||
require "formula"
|
require "formula"
|
||||||
require "tab"
|
require "tab"
|
||||||
require "diagnostic"
|
require "diagnostic"
|
||||||
require "cli/parser"
|
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module Cmd
|
||||||
|
class Missing < AbstractCommand
|
||||||
sig { returns(CLI::Parser) }
|
cmd_args do
|
||||||
def missing_args
|
|
||||||
Homebrew::CLI::Parser.new do
|
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Check the given <formula> kegs for missing dependencies. If no <formula> are
|
Check the given <formula> kegs for missing dependencies. If no <formula> are
|
||||||
provided, check all kegs. Will exit with a non-zero status if any kegs are found
|
provided, check all kegs. Will exit with a non-zero status if any kegs are found
|
||||||
@ -23,11 +21,9 @@ module Homebrew
|
|||||||
|
|
||||||
named_args :formula
|
named_args :formula
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def missing
|
|
||||||
args = missing_args.parse
|
|
||||||
|
|
||||||
|
sig { override.void }
|
||||||
|
def run
|
||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
|
|
||||||
ff = if args.no_named?
|
ff = if args.no_named?
|
||||||
@ -46,3 +42,5 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "cmd/missing"
|
||||||
require "cmd/shared_examples/args_parse"
|
require "cmd/shared_examples/args_parse"
|
||||||
|
|
||||||
RSpec.describe "brew missing" do
|
RSpec.describe Homebrew::Cmd::Missing do
|
||||||
it_behaves_like "parseable arguments"
|
it_behaves_like "parseable arguments"
|
||||||
|
|
||||||
it "prints missing dependencies", :integration_test do
|
it "prints missing dependencies", :integration_test do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user