home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ruby164.zip / rbemx164.zip / ruby / share / doc / optparse-0.8.2 / cmd-ls.rb < prev    next >
Text File  |  2001-06-18  |  329b  |  16 lines

  1. #! /usr/bin/ruby
  2.  
  3. parser = OptionParser.new do |q|
  4.   q.banner = "Usage: #{$0} [common-options] ls [options]\n"
  5.   q.on('--directory=DIR', 'change directory', String) {|dir|Dir.chdir(dir)}
  6. end
  7. begin
  8.   parser.parse!(ARGV)
  9. rescue OptionParser::ParseError
  10.   STDERR.puts parser
  11.   exit 1
  12. end
  13. $cmd = proc {|*args| system('ls', *args)}
  14.  
  15.  
  16.