From ba0fa55f3f8943135851e6a44a878980ac87902c Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 26 Sep 2024 11:58:33 -0400 Subject: [PATCH] cmd/list: `-t` and `-r` support for some long options --- Library/Homebrew/cmd/list.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 1e970481fb5a9b..d1d4dcaad62b7b 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -122,7 +122,13 @@ def run raise UsageError, "Cannot use #{flags.join(", ")} with formula arguments." unless args.no_named? - Formula.installed.sort.each do |formula| + formulae = if args.t? + Formula.installed.sort_by { |formula| test("M", formula.prefix.realpath) }.reverse! + else + Formula.installed.sort + end + formulae.reverse! if args.r? + formulae.each do |formula| tab = Tab.for_formula(formula) statuses = []