https://github.com/rvm/extoptparse
https://github.com/rvm/extoptparse
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rvm/extoptparse
- Owner: rvm
- License: agpl-3.0
- Created: 2017-08-06T23:43:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T10:27:07.000Z (over 8 years ago)
- Last Synced: 2025-02-24T23:58:57.493Z (11 months ago)
- Language: Ruby
- Size: 19.5 KB
- Stars: 0
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Extoptparse
[](http://rubygems.org/gems/extoptparse)
[](https://codeclimate.com/github/rvm/extoptparse)
[](https://coveralls.io/r/rvm/extoptparse)
[](https://travis-ci.org/rvm/extoptparse)
[](https://gemnasium.com/rvm/extoptparse)
[](http://inch-ci.org/github/rvm/extoptparse)
[](http://rubydoc.info/github/rvm/extoptparse/master/frames)
[](https://github.com/rvm/extoptparse)
[](http://www.gnu.org/licenses/agpl.html)
Add grouping to Ruby's `OptionParser`
Extoptparse works with *ruby 1.9.3+*.
## Usage
```ruby
p = ExtOptParse.new
p.group(:group1) { p.on("-a", "A") }
p.group(:group2) { p.on("-b", "B") }
p.group(:group1) { p.on("-c", "C") }
puts p.help
...
-b B
-a A
-c C
...
```
## Testing
```bash
rake
```
## License
Copyright 2017 Michal Papis
This file is part of extoptparse.
Extoptparse is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Extoptparse 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. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with extoptparse. If not, see .