| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 18:25:08 +09:00
										 |  |  | require "cli/parser" | 
					
						
							| 
									
										
										
										
											2018-11-10 23:31:23 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-09 22:42:46 +08:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2016-09-26 01:44:51 +02:00
										 |  |  |   module_function | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-10 23:31:23 +05:30
										 |  |  |   def tap_unpin_args | 
					
						
							|  |  |  |     Homebrew::CLI::Parser.new do | 
					
						
							|  |  |  |       usage_banner <<~EOS | 
					
						
							|  |  |  |         `tap-unpin` <tap> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 21:32:35 +00:00
										 |  |  |         Unpin <tap> so its formulae are no longer prioritised. See also `tap-pin`. | 
					
						
							| 
									
										
										
										
											2018-11-10 23:31:23 +05:30
										 |  |  |       EOS | 
					
						
							|  |  |  |       switch :debug | 
					
						
							| 
									
										
										
										
											2019-03-30 10:17:34 +00:00
										 |  |  |       hide_from_man_page! | 
					
						
							| 
									
										
										
										
											2018-11-10 23:31:23 +05:30
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-09 22:42:46 +08:00
										 |  |  |   def tap_unpin | 
					
						
							| 
									
										
										
										
											2019-03-30 10:17:34 +00:00
										 |  |  |     odeprecated "brew tap-pin user/tap", | 
					
						
							| 
									
										
										
										
											2019-04-30 08:44:35 +01:00
										 |  |  |                 "fully-scoped user/tap/formula naming" | 
					
						
							| 
									
										
										
										
											2019-03-30 10:17:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-10 23:31:23 +05:30
										 |  |  |     tap_unpin_args.parse | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-25 11:33:38 +02:00
										 |  |  |     ARGV.named.each do |name| | 
					
						
							| 
									
										
										
										
											2015-12-07 14:11:04 +08:00
										 |  |  |       tap = Tap.fetch(name) | 
					
						
							| 
									
										
										
										
											2016-04-02 21:33:38 +08:00
										 |  |  |       raise "unpinning #{tap} is not allowed" if tap.core_tap? | 
					
						
							| 
									
										
										
										
											2018-09-17 02:45:00 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-09 22:42:46 +08:00
										 |  |  |       tap.unpin | 
					
						
							| 
									
										
										
										
											2016-03-07 18:08:37 +08:00
										 |  |  |       ohai "Unpinned #{tap}" | 
					
						
							| 
									
										
										
										
											2015-08-09 22:42:46 +08:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |