| 
									
										
										
										
											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" | 
					
						
							| 
									
										
										
										
											2022-07-14 13:16:26 -07:00
										 |  |  | 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 |