| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 18:25:08 +09:00
										 |  |  | require "cli/parser" | 
					
						
							| 
									
										
										
										
											2016-04-17 09:21:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 22:41:47 -05:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2016-09-26 01:44:51 +02:00
										 |  |  |   module_function | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-30 21:29:49 +00:00
										 |  |  |   def __repository_args | 
					
						
							|  |  |  |     Homebrew::CLI::Parser.new do | 
					
						
							|  |  |  |       usage_banner <<~EOS | 
					
						
							| 
									
										
										
										
											2019-08-06 14:17:17 -04:00
										 |  |  |         `--repository`, `--repo` [<user>`/`<repo>] | 
					
						
							| 
									
										
										
										
											2019-01-30 21:29:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         Display where Homebrew's `.git` directory is located. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         If <user>`/`<repo> are provided, display where tap <user>`/`<repo>'s directory is located. | 
					
						
							|  |  |  |       EOS | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  |   def __repository | 
					
						
							| 
									
										
										
										
											2019-01-30 21:29:49 +00:00
										 |  |  |     __repository_args.parse | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-23 16:33:40 +08:00
										 |  |  |     if ARGV.named.empty? | 
					
						
							|  |  |  |       puts HOMEBREW_REPOSITORY | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |       puts ARGV.named.map { |tap| Tap.fetch(tap).path } | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | end |