Commits

Nicolas Cavigneaux committed 346c920

Documented CommandLine

  • Participants
  • Parent commits 8ec44d6

Comments (0)

Files changed (2)

lib/command_line.rb

 class Renamer
+  # Process command-line arguments
   class CommandLine
     attr_accessor :action, :arg, :recursive, :overwrite, :opts, :filenames
     
     
     private
     
+    # Define available options
     def feed
       opts = OptionParser.new
       
       self.opts = opts
     end
     
+    # Parse arguments
     def parse
       if ARGV.empty?
           puts self.opts.to_s
       self.filenames = self.opts.parse(ARGV)
     end
     
+    # Send the requested job to Renamer
     def process
       r = Renamer.new(self.filenames, self.recursive, self.overwrite)
 

test/ts_renamer.rb

 require 'fileutils'
 require 'const'
 require 'renamer'
+require 'command_line'
 
-require 'tc_renamer_procs'
+require 'tc_renamer_procs'
+require 'tc_renamer_command_line'