<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -48,6 +48,7 @@ opts = OptionParser.new() { |opts|
 Examples:
 
     rtags *.rb
+    rtags -x *.rb
     rtags -R &lt;path&gt;
     rtags --vi -f vim_tags *.rb
     rtags `find ~/src/ -name *.rb|grep -v _darcs`
@@ -68,6 +69,12 @@ EXAMPLE
   opts.on(&quot;--vi&quot;, &quot;Use vi type tags (default is emacs)&quot;) do 
     $options.vi = true
   end
+  opts.on(&quot;-x&quot;, &quot;Print cross reference file to stdout&quot;) do
+    $options.xref = true
+  end
+  opts.on(&quot;-b&quot;, &quot;When using -x, only print base name. E.g., print only 'method' and not '::Module::Class#method'&quot;) do
+    $options.xref_only_base = true
+  end
   opts.on(&quot;--quiet&quot;, &quot;Quiet mode&quot;) do 
     $options.quiet = true
   end
@@ -96,7 +103,7 @@ if $options.recurse and ARGV.size==0
 	ARGV.push '.'
 end
 
-print &quot;\nrtags.rb #{RTAGS_VERSION} writing to file '#{$options.tagfile}'\n&quot; if !$options.quiet
+print &quot;\nrtags.rb #{RTAGS_VERSION} writing to file '#{$options.tagfile}'\n&quot; if (!$options.quiet &amp;&amp; !$options.xref)
 
 require &quot;e2mmap&quot;
 require &quot;tracer&quot;
@@ -239,7 +246,7 @@ module RTAGS
 		# Scan +@input_file_name+ for tags and yields each tag
 
     def scan(&amp;block)
-      print &quot;\nParsing #{@input_file_name}...&quot; if !$options.quiet
+      print &quot;\nParsing #{@input_file_name}...&quot; if (!$options.quiet &amp;&amp; !$options.xref)
       File.open(@input_file_name) do |input|
         @tokens = []
         @unget_readed = []
@@ -450,7 +457,12 @@ module RTAGS
 
     def parse_alias(context, single, tk, &amp;block)
       skip_tkspace
-      name = get_tk.name
+      if (token = get_tk).is_a? TkSYMBEG
+        # Name is in next token
+        token = get_tk
+      end
+
+      name = token.name
       if context
         if single == SINGLE
           yield RTSingleAlias.new(get_tkreaded, context, name, tk)
@@ -583,7 +595,7 @@ module RTAGS
 
 		# Test for boring repository directories that should be skipped
 		def Filter::skipdir name
-			if name =~ /\/(\.svn|\.hg|_darcs|CVS)/
+			if name =~ /\/(\.svn|\.hg|_darcs|CVS|\.git)/
 				print &quot;\nSkipping boring directory #{name}&quot;
 				return true
 			end
@@ -691,6 +703,44 @@ module RTAGS
       end
     end
   end
+
+  class XREF_TAGS &lt; TAGS
+    # Print cross ref file (like ctags -x)
+    def shipout
+      output = []
+      for fn in @files
+        if File.directory? fn
+          puts &quot;\nWarning: #{fn} is a directory - SKIPPING. Specify --recurse option to recurse into directories.\n&quot;
+          next
+        end
+
+        size = 0
+        
+        $stderr.printf &quot;--\n-- parse file: %s\n&quot;, fn if $options.debug
+        parser = Parser.new(fn)
+        parser.scan do |tk|
+          $stderr.print tk, &quot;\n&quot; if $options.debug
+          line = tk.readed.split(/\n/)[0]
+          output.push sprintf(&quot;%-16s %4d %-16s %s\n&quot;,
+                              tk.name,
+                              tk.line_no,
+                              fn,
+                              line)
+
+          unless $options.xref_only_base
+            output.push sprintf(&quot;%-16s %4d %-16s %s\n&quot;,
+                                tk.abs_name,
+                                tk.line_no,
+                                fn,
+                                line)
+          end
+        end
+      end
+      puts output.join
+    end
+  end
+
+  
 end
 
 if ARGV.size == 0 or ARGV[0] == '--help'
@@ -701,9 +751,11 @@ end
 
 if $options.vi
   tags = RTAGS::VI_TAGS.new(ARGV)
+elsif $options.xref
+  tags = RTAGS::XREF_TAGS.new(ARGV)
 else
   tags = RTAGS::EMACS_TAGS.new(ARGV)
 end
 tags.shipout
-print &quot;\n&quot;
-$stderr.print &quot;\nEnd - tagfile generated\n&quot; if !$options.quiet
+print &quot;\n&quot; if !$options.xref
+$stderr.print &quot;\nEnd - tagfile generated\n&quot; if (!$options.quiet &amp;&amp; !$options.xref)</diff>
      <filename>bin/rtags</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7de22509aa0e5771244b508ed87a022a748253f4</id>
    </parent>
    <parent>
      <id>f8a692e2ef09fca1d8abd3e068a6f6965eb3df68</id>
    </parent>
  </parents>
  <author>
    <name>Pjotr</name>
    <email>pjotr.public05@thebird.nl</email>
  </author>
  <url>http://github.com/gaizka/rtags/commit/916a234cc8967fb87a9bc3d6788a17fa9acf6da4</url>
  <id>916a234cc8967fb87a9bc3d6788a17fa9acf6da4</id>
  <committed-date>2008-10-03T23:57:30-07:00</committed-date>
  <authored-date>2008-10-03T23:57:30-07:00</authored-date>
  <message>Merge commit 'gaizka/master' into test</message>
  <tree>8541e918afe8b8d144aca352f26b3d99b2c26e02</tree>
  <committer>
    <name>Pj</name>
    <email>pjotr.public05@thebird.nl</email>
  </committer>
</commit>
