brew/Library/Homebrew/cmd/leaves.rb

29 lines
488 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
require "formula"
2019-04-17 18:25:08 +09:00
require "cli/parser"
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
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-01 01:57:02 -04:00
leaves = Formula.installed_non_deps.map(&:full_name).sort
2018-03-25 12:43:04 +01:00
leaves.each(&method(:puts))
end
end