2020-11-25 17:03:23 +01:00
|
|
|
# typed: true
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-08-03 13:09:07 +01:00
|
|
|
require "formula"
|
2019-04-17 18:25:08 +09:00
|
|
|
require "cli/parser"
|
2013-11-16 14:10:23 -06:00
|
|
|
|
2014-06-18 22:41:47 -05:00
|
|
|
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`
|
|
|
|
|
2019-08-19 22:44:50 -04:00
|
|
|
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
|
|
|
|
2021-01-10 14:26:40 -05:00
|
|
|
named_args :none
|
2018-11-11 19:13:28 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-11-16 14:10:23 -06:00
|
|
|
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))
|
2013-11-16 14:10:23 -06:00
|
|
|
end
|
|
|
|
end
|