~ubuntu-branches/ubuntu/intrepid/ruby1.8/intrepid-updates

« back to all changes in this revision

Viewing changes to sample/getopts.test

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/local/bin/ruby
 
2
 
 
3
load("parsearg.rb")
 
4
 
 
5
def usage()
 
6
  printf "Usage:\n"
 
7
  printf "%s -d [-x x] [-y y] [--geometry geom] [--version] [string ...]\n", $0
 
8
end
 
9
 
 
10
$USAGE = 'usage'
 
11
parseArgs(0, "d&(x|y)", "dfg", "x:", "y:", "geometry:800x600", "version")
 
12
if ($OPT_d)
 
13
  if $OPT_version
 
14
    printf "version 1.0\n"
 
15
  end
 
16
  if ($OPT_x)
 
17
    printf("x = %d\n", $OPT_x.to_i)
 
18
  end
 
19
  if ($OPT_y)
 
20
    printf("y = %d\n", $OPT_y.to_i)
 
21
  end
 
22
  if ($OPT_geometry)
 
23
    printf("geometry = %s\n", $OPT_geometry)
 
24
  end
 
25
  if $OPT_f
 
26
    printf "f = TRUE\n"
 
27
  end
 
28
  if $OPT_g
 
29
    printf "g = TRUE\n"
 
30
  end
 
31
end
 
32
 
 
33
while (ARGV.length != 0)
 
34
  print "other = ", ARGV[0], "\n"
 
35
  ARGV.shift
 
36
end