getoptlong.rb

Path: lib/more/facets/getoptlong.rb
Last Update: Thu Jun 24 13:18:25 +0000 2010

GetoptLong

Ruby‘s standard GetoptLong class with an added DSL.

  opts = GetoptLong.new do
    reqs '--expect', '-x'
    flag '--help', '-h'
  end

  opts.each { |opt, arg|
    ...
  }

Authors

  • Thomas Sawuer

Copying

Copyright (c) 2007 Thomas Sawyer

Ruby License

This module is free software. You may use, modify, and/or redistribute this software under the same terms as Ruby.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Required files

getoptlong  

[Validate]