File: cmd-ls.rb

package info (click to toggle)
liboptparse-ruby 0.8.4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 428 kB
  • ctags: 644
  • sloc: ruby: 1,819; makefile: 47
file content (15 lines) | stat: -rwxr-xr-x 329 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/ruby

parser = OptionParser.new do |q|
  q.banner = "Usage: #{$0} [common-options] ls [options]\n"
  q.on('--directory=DIR', 'change directory', String) {|dir|Dir.chdir(dir)}
end
begin
  parser.parse!(ARGV)
rescue OptionParser::ParseError
  STDERR.puts parser
  exit 1
end
$cmd = proc {|*args| system('ls', *args)}