brew/Library/Homebrew/cmd/leaves.rb

31 lines
534 B
Ruby
Raw Normal View History

2020-11-25 17:03:23 +01:00
# typed: true
# frozen_string_literal: true
require "formula"
2019-04-17 18:25:08 +09:00
require "cli/parser"
module Homebrew
2020-10-20 12:03:48 +02:00
extend T::Sig
2016-09-26 01:44:51 +02:00
module_function
2020-10-20 12:03:48 +02:00
sig { returns(CLI::Parser) }
2018-11-11 19:13:28 +05:30
def leaves_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`leaves`
List installed formulae that are not dependencies of another installed formula.
2018-11-11 19:13:28 +05:30
EOS
2020-07-30 18:40:10 +02:00
max_named 0
2018-11-11 19:13:28 +05:30
end
end
def leaves
2018-11-11 19:13:28 +05:30
leaves_args.parse
2020-11-05 12:27:22 -05:00
Formula.installed_formulae_with_no_dependents.map(&:full_name).sort.each(&method(:puts))
end
end