brew/Library/Homebrew/cmd/autoremove.rb

27 lines
631 B
Ruby
Raw Permalink Normal View History

2023-08-08 13:54:59 -07:00
# typed: strict
2020-09-10 19:45:02 +02:00
# frozen_string_literal: true
2024-03-29 16:20:40 -07:00
require "abstract_command"
require "cleanup"
2020-09-10 19:45:02 +02:00
module Homebrew
2024-03-29 16:20:40 -07:00
module Cmd
class Autoremove < AbstractCommand
cmd_args do
description <<~EOS
Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed.
EOS
switch "-n", "--dry-run",
description: "List what would be uninstalled, but do not actually uninstall anything."
2020-11-12 10:40:41 -05:00
2024-03-29 16:20:40 -07:00
named_args :none
end
2020-09-10 19:45:02 +02:00
2024-03-29 16:20:40 -07:00
sig { override.void }
def run
Cleanup.autoremove(dry_run: args.dry_run?)
end
end
2020-09-10 19:45:02 +02:00
end
end