Sha256: d74e49c8b31310959630ad64ae783052f18a121720a450473abb8367cfba34a7
Contents?: true
Size: 768 Bytes
Versions: 2
Compression:
Stored size: 768 Bytes
Contents
#!/usr/bin/env ruby require 'getoptlong' require_relative '../lib/rdoc_link_checker' options = GetoptLong.new( ['--html_dirpath', '-d', GetoptLong::REQUIRED_ARGUMENT], ['--version', '-v', GetoptLong::NO_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT] ) message = nil case ARGV.size when 0 message = "Expected one argument; got none." when 1 # Okay. else message = "Expected one argument, not #{ARGV.inspect}." end raise ArgumentError.new(message) if message def help puts 'Boo!' end def version puts RDocLinkChecker::VERSION end options.each do |option, argument| case option when '--help' help when '--version' version end end html_dirpath = ARGV[0] RDocLinkChecker.new(html_dirpath)
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rdoc_link_checker-0.2.0 | bin/rdoc_link_checker |
rdoc_link_checker-0.1.0 | bin/rdoc_link_checker |