diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-12 21:44:13 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-12 21:44:13 +0000 |
commit | 98258515dd70c65174cb19b09fb93c217957daab (patch) | |
tree | 906022d44655a0237c5342730c7c6f0b748ec911 /ext/ripper/tools/list-scan-event-ids.rb | |
parent | 5cdf9a0a199c1b380140de09ac467c3aa9bdaa69 (diff) |
* ext/ripper/tools/list-parse-event-ids.rb: does not use getopts.
* ext/ripper/tools/list-scan-event-ids.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper/tools/list-scan-event-ids.rb')
-rwxr-xr-x | ext/ripper/tools/list-scan-event-ids.rb | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/ext/ripper/tools/list-scan-event-ids.rb b/ext/ripper/tools/list-scan-event-ids.rb index 6f25362b5d..28cd8bbe8a 100755 --- a/ext/ripper/tools/list-scan-event-ids.rb +++ b/ext/ripper/tools/list-scan-event-ids.rb @@ -1,23 +1,14 @@ -# -# list-scan-event-ids.rb -# - -require 'getopts' - -def usage(status) - (status == 0 ? $stdout : $stderr).puts(<<EOS) -Usage: #{File.basename($0)} eventids2.c - -a print IDs with arity. -EOS - exit status -end +# $Id$ def main - ok = getopts('a', 'help') - usage 0 if $OPT_help - usage 1 unless ok + if ARGV.first == '-a' + with_arity = true + ARGV.delete_at 0 + else + with_arity = false + end extract_ids(ARGF).sort.each do |id| - if $OPT_a + if with_arity puts "#{id} 1" else puts id |