brew/Library/Homebrew/cmd/autoremove.rb

28 lines
606 B
Ruby
Raw Normal View History

2020-11-25 17:03:23 +01:00
# typed: true
2020-09-10 19:45:02 +02:00
# frozen_string_literal: true
require "cleanup"
2020-09-10 19:45:02 +02:00
require "cli/parser"
module Homebrew
module_function
def autoremove_args
Homebrew::CLI::Parser.new do
description <<~EOS
2020-11-06 10:36:21 -05:00
Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed.
2020-09-10 19:45:02 +02:00
EOS
switch "-n", "--dry-run",
2020-11-06 10:36:21 -05:00
description: "List what would be uninstalled, but do not actually uninstall anything."
2020-11-12 10:40:41 -05:00
2021-01-10 14:26:40 -05:00
named_args :none
2020-09-10 19:45:02 +02:00
end
end
def autoremove
args = autoremove_args.parse
Cleanup.autoremove(dry_run: args.dry_run?)
2020-09-10 19:45:02 +02:00
end
end