brew/Library/Homebrew/cmd/leaves.rb
2020-11-04 16:45:14 -05:00

29 lines
488 B
Ruby

# typed: false
# frozen_string_literal: true
require "formula"
require "cli/parser"
module Homebrew
module_function
def leaves_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`leaves`
List installed formulae that are not dependencies of another installed formula.
EOS
max_named 0
end
end
def leaves
leaves_args.parse
leaves = Formula.installed_non_deps.map(&:full_name).sort
leaves.each(&method(:puts))
end
end