| 
									
										
										
										
											2016-04-08 16:28:43 +02:00
										 |  |  | #:  * `cat` <formula>: | 
					
						
							|  |  |  | #:    Display the source to <formula>. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 22:41:47 -05:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  |   def cat | 
					
						
							|  |  |  |     # do not "fix" this to support multiple arguments, the output would be | 
					
						
							|  |  |  |     # unparsable, if the user wants to cat multiple formula they can call | 
					
						
							|  |  |  |     # brew cat multiple times. | 
					
						
							| 
									
										
										
										
											2015-10-25 01:13:16 +01:00
										 |  |  |     formulae = ARGV.formulae | 
					
						
							|  |  |  |     raise FormulaUnspecifiedError if formulae.empty? | 
					
						
							|  |  |  |     raise "`brew cat` doesn't support multiple arguments" if formulae.size > 1
 | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     cd HOMEBREW_REPOSITORY | 
					
						
							| 
									
										
										
										
											2015-10-25 01:13:16 +01:00
										 |  |  |     exec "cat", formulae.first.path, *ARGV.options_only | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | end |