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
|
||||
|
||||
require "abstract_command"
|
||||
require "formula"
|
||||
require "tab"
|
||||
require "diagnostic"
|
||||
require "cli/parser"
|
||||
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def missing_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
module Cmd
|
||||
class Missing < AbstractCommand
|
||||
cmd_args do
|
||||
description <<~EOS
|
||||
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
|
||||
@ -23,11 +21,9 @@ module Homebrew
|
||||
|
||||
named_args :formula
|
||||
end
|
||||
end
|
||||
|
||||
def missing
|
||||
args = missing_args.parse
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
return unless HOMEBREW_CELLAR.exist?
|
||||
|
||||
ff = if args.no_named?
|
||||
@ -45,4 +41,6 @@ module Homebrew
|
||||
puts missing.join(" ")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,8 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "cmd/missing"
|
||||
require "cmd/shared_examples/args_parse"
|
||||
|
||||
RSpec.describe "brew missing" do
|
||||
RSpec.describe Homebrew::Cmd::Missing do
|
||||
it_behaves_like "parseable arguments"
|
||||
|
||||
it "prints missing dependencies", :integration_test do
|
||||
|
Loading…
x
Reference in New Issue
Block a user