<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1 +1,12 @@
---files docs/WHATSNEW.markdown,docs/GETTING_STARTED.markdown,docs/OVERVIEW.markdown,docs/CODE_OBJECTS.markdown,docs/TAGS.markdown,docs/PARSER.markdown,docs/HANDLERS.markdown,docs/GENERATORS.markdown,docs/FAQ.markdown,docs/GLOSSARY.markdown,LICENSE
+-
+docs/WHATSNEW.markdown
+docs/GETTING_STARTED.markdown
+docs/OVERVIEW.markdown
+docs/CODE_OBJECTS.markdown
+docs/TAGS.markdown
+docs/PARSER.markdown
+docs/HANDLERS.markdown
+docs/GENERATORS.markdown
+docs/FAQ.markdown
+docs/GLOSSARY.markdown
+LICENSE</diff>
      <filename>.yardopts</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,7 @@ module YARD
           :format =&gt; :html, 
           :template =&gt; :default, 
           :serializer =&gt; YARD::Serializers::FileSystemSerializer.new, 
+          :files =&gt; [],
           :verifier =&gt; lambda do |gen, obj| 
             return false if gen.respond_to?(:visibility) &amp;&amp; !visibilities.include?(gen.visibility) 
           end
@@ -23,7 +24,6 @@ module YARD
         @visibilities = [:public]
         @reload = true
         @generate = true
-        @files = ['lib/**/*.rb']
         @options_file = DEFAULT_YARDOPTS_FILE
       end
       
@@ -56,14 +56,47 @@ module YARD
         []
       end
       
+      def add_extra_files(*files)
+        files.map! {|f| f.include?(&quot;*&quot;) ? Dir.glob(f) : f }.flatten!
+        files.each do |file|
+          raise Errno::ENOENT, &quot;Could not find extra file: #{file}&quot; unless File.file?(file)
+          options[:files] &lt;&lt; file
+        end
+      end
+      
+      def parse_files(*files)
+        self.files = []
+        seen_extra_files_marker = false
+        
+        files.each do |file|
+          if file == &quot;-&quot;
+            seen_extra_files_marker = true
+            next
+          end
+          
+          if seen_extra_files_marker
+            add_extra_files(file)
+          else
+            self.files &lt;&lt; file
+          end
+        end
+        
+        self.files = ['lib/**/*.rb'] if self.files.empty?
+      end
+      
       def optparse(*args)
         serialopts = SymbolHash.new
         
         opts = OptionParser.new
-        opts.banner = &quot;Usage: yardoc [options] [source files]&quot;
+        opts.banner = &quot;Usage: yardoc [options] [source_files [- extra_files]]&quot;
 
         opts.separator &quot;(if a list of source files is omitted, lib/**/*.rb is used.)&quot;
         opts.separator &quot;&quot;
+        opts.separator &quot;Example: yardoc -o documentation/ - FAQ LICENSE&quot;
+        opts.separator &quot;  The above example outputs documentation for files in&quot;
+        opts.separator &quot;  lib/**/*.rb to documentation/ including the extra files&quot;
+        opts.separator &quot;  FAQ and LICENSE.&quot;
+        opts.separator &quot;&quot;
         opts.separator &quot;A base set of options can be specified by adding a .yardopts&quot;
         opts.separator &quot;file to your base path containing all extra options separated&quot;
         opts.separator &quot;by whitespace.&quot;
@@ -120,11 +153,7 @@ module YARD
         end
         
         opts.on('--files FILE1,FILE2,...', 'Any extra comma separated static files to be included (eg. FAQ)') do |files|
-          options[:files] = []
-          files.split(&quot;,&quot;).each do |file|
-            raise Errno::ENOENT, file unless File.file?(file)
-            options[:files] &lt;&lt; file
-          end
+          add_extra_files *files.split(&quot;,&quot;)
         end
 
         opts.on('-m', '--markup MARKUP', 
@@ -174,8 +203,7 @@ module YARD
         end
         
         # Last minute modifications
-        self.files = args unless args.empty?
-        self.reload = false if self.files.empty?
+        parse_files(*args) unless args.empty?
         self.visibilities.uniq!
         options[:serializer] ||= Serializers::FileSystemSerializer.new(serialopts)
       end</diff>
      <filename>lib/yard/cli/yardoc.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,4 +40,27 @@ describe YARD::CLI::Yardoc do
     @yardoc.options[:serializer].options[:basepath].should == :MYPATH
     @yardoc.files.should == [&quot;FILE1&quot;, &quot;FILE2&quot;, &quot;FILE3&quot;]
   end
+  
+  it &quot;should accept extra files if specified after '-' with source files&quot; do
+    File.should_receive(:file?).with('extra_file1').and_return(true)
+    File.should_receive(:file?).with('extra_file2').and_return(true)
+    @yardoc.optparse *%w( file1 file2 - extra_file1 extra_file2 )
+    @yardoc.files.should == %w( file1 file2 )
+    @yardoc.options[:files].should == %w( extra_file1 extra_file2 )
+  end
+  
+  it &quot;should accept files section only containing extra files&quot; do
+    @yardoc.optparse *%w( - LICENSE )
+    @yardoc.files.should == %w( lib/**/*.rb )
+    @yardoc.options[:files].should == %w( LICENSE )
+  end
+
+  it &quot;should accept globs as extra files&quot; do
+    Dir.should_receive(:glob).with('*.txt').and_return ['a.txt', 'b.txt']
+    File.should_receive(:file?).with('a.txt').and_return(true)
+    File.should_receive(:file?).with('b.txt').and_return(true)
+    @yardoc.optparse *%w( file1 file2 - *.txt )
+    @yardoc.files.should == %w( file1 file2 )
+    @yardoc.options[:files].should == %w( a.txt b.txt )
+  end
 end
\ No newline at end of file</diff>
      <filename>spec/cli/yardoc_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>72a92e634d9f319ef1771c6c2f5da223aef6a195</id>
    </parent>
  </parents>
  <author>
    <name>Loren Segal</name>
    <email>lsegal@soen.ca</email>
  </author>
  <url>http://github.com/lsegal/yard/commit/8e8aebdf3e1b818f85c05f87cf56150daaae12f3</url>
  <id>8e8aebdf3e1b818f85c05f87cf56150daaae12f3</id>
  <committed-date>2009-07-06T14:38:37-07:00</committed-date>
  <authored-date>2009-07-06T14:38:37-07:00</authored-date>
  <message>Update yardoc CLI to accept extra files after source files with '-' separator

Example: yardoc lib/**/*.rb - FAQ LICENSE</message>
  <tree>2178b8cdff89ac70e0c3625efd15b816d548196f</tree>
  <committer>
    <name>Loren Segal</name>
    <email>lsegal@soen.ca</email>
  </committer>
</commit>
