A summary of data about the Ruby ecosystem.

https://github.com/ruby/optparse

OptionParser is a class for command-line option analysis.
https://github.com/ruby/optparse

Keywords

hacktoberfest ruby

Keywords from Contributors

repl rubygems bigdecimal debugger webrick debugging-tool strscan documentation-tool activerecord mvc

Last synced: about 2 hours ago
JSON representation

Repository metadata

OptionParser is a class for command-line option analysis.

README.md

OptionParser

OptionParser is a class for command-line option analysis. It is much more
advanced, yet also easier to use, than GetoptLong, and is a more Ruby-oriented
solution.

Features

  1. The argument specification and the code to handle it are written in the
    same place.
  2. It can output an option summary; you don't need to maintain this string
    separately.
  3. Optional and mandatory arguments are specified very gracefully.
  4. Arguments can be automatically converted to a specified class.
  5. Arguments can be restricted to a certain set.

Installation

Add this line to your application's Gemfile:

gem 'optparse'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install optparse

Usage

Full documentation is here.

require 'optparse'

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: example.rb [options]"

  opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
    options[:verbose] = v
  end
end.parse!

p options
p ARGV

Development

After checking out the repo, run bundle install to install dependencies. Then, run rake test to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/optparse.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 405
Total Committers: 41
Avg Commits per committer: 9.878
Development Distribution Score (DDS): 0.425

Commits in past year: 57
Committers in past year: 9
Avg Commits per committer in past year: 6.333
Development Distribution Score (DDS) in past year: 0.614

Name Email Commits
nobu n****u@b****e 233
Hiroshi SHIBATA h****t@r****g 43
dependabot[bot] 4****] 27
matz m****z@b****e 15
Burdette Lamar B****r@Y****m 15
kazu k****u@b****e 7
zzak z****k@b****e 5
akr a****r@b****e 5
Yusuke Endoh m****e@r****g 4
drbrain d****n@b****e 4
Sam Westerman s****m@s****e 4
Olle Jonsson o****n@g****m 4
Jeremy Evans c****e@j****t 4
ko1 k****1@b****e 3
gsinclair g****r@b****e 2
Takashi Kokubun t****n@g****m 2
fatkodima f****3@g****m 2
naruse n****e@b****e 2
stomar s****r@b****e 2
AJ Jordan a****x@s****t 1
zverok z****e@g****m 1
ydah 1****h 1
usa u****a@b****e 1
shugo s****o@b****e 1
nagachika n****a@b****e 1
kwatch k****h@g****m 1
ktsj k****j@b****e 1
konsolebox k****x@g****m 1
a_matsuda a****a@b****e 1
Whyme Lyu 5****a@g****m 1
and 11 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 18
Total pull requests: 129
Average time to close issues: 2 months
Average time to close pull requests: 14 days
Total issue authors: 15
Total pull request authors: 28
Average comments per issue: 0.94
Average comments per pull request: 0.52
Merged pull request: 111
Bot issues: 0
Bot pull requests: 31

Past year issues: 3
Past year pull requests: 39
Past year average time to close issues: 3 days
Past year average time to close pull requests: 6 days
Past year issue authors: 3
Past year pull request authors: 9
Past year average comments per issue: 1.33
Past year average comments per pull request: 0.08
Past year merged pull request: 31
Past year bot issues: 0
Past year bot pull requests: 15

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/ruby/optparse

Top Issue Authors

  • kwatch (3)
  • BurdetteLamar (2)
  • bkuhlmann (1)
  • s7pdragon (1)
  • BrianLMatthews (1)
  • postmodern (1)
  • castor4bit (1)
  • ETLJ (1)
  • Earlopain (1)
  • nobu (1)
  • joshdholtz (1)
  • JunichiIto (1)
  • rafaelfranca (1)
  • Watson1978 (1)
  • TApplencourt (1)

Top Pull Request Authors

  • dependabot[bot] (31)
  • nobu (29)
  • BurdetteLamar (17)
  • hsbt (11)
  • kwatch (4)
  • olleolleolle (4)
  • fatkodima (4)
  • jeremyevans (3)
  • sampersand (3)
  • kyanagi (2)
  • AlexWayfer (2)
  • sw-square (2)
  • k0kubun (2)
  • edgibbs (1)
  • toy (1)

Top Issue Labels

  • documentation (1)

Top Pull Request Labels

  • dependencies (31)
  • documentation (16)
  • github_actions (15)
  • enhancement (2)

Package metadata

gem.coop: optparse

OptionParser is a class for command-line option analysis. It is much more advanced, yet also easier to use, than GetoptLong, and is a more Ruby-oriented solution.

  • Homepage: https://github.com/ruby/optparse
  • Documentation: http://www.rubydoc.info/gems/optparse/
  • Licenses: Ruby,BSD-2-Clause
  • Latest release: 0.8.1 (published 3 months ago)
  • Last Synced: 2026-02-28T18:01:08.110Z (3 days ago)
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 97,361,251 Total
  • Docker Downloads: 3,298,615,259
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.101%
    • Downloads: 0.302%
  • Maintainers (3)
rubygems.org: optparse

OptionParser is a class for command-line option analysis. It is much more advanced, yet also easier to use, than GetoptLong, and is a more Ruby-oriented solution.

  • Homepage: https://github.com/ruby/optparse
  • Documentation: http://www.rubydoc.info/gems/optparse/
  • Licenses: Ruby,BSD-2-Clause
  • Latest release: 0.8.1 (published 3 months ago)
  • Last Synced: 2026-02-26T11:01:37.201Z (5 days ago)
  • Versions: 11
  • Dependent Packages: 48
  • Dependent Repositories: 4,936
  • Downloads: 97,096,215 Total
  • Docker Downloads: 3,298,615,259
  • Rankings:
    • Docker downloads count: 0.033%
    • Dependent repos count: 0.451%
    • Downloads: 0.525%
    • Dependent packages count: 0.656%
    • Average: 2.556%
    • Forks count: 5.622%
    • Stargazers count: 8.047%
  • Maintainers (3)

Dependencies

Gemfile rubygems
  • rake >= 0
  • test-unit >= 0
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • ruby/setup-ruby v1 composite
.github/actions/package/action.yml actions
  • actions/upload-artifact v4 composite
.github/workflows/codeql.yml actions
  • actions/checkout v5 composite
  • github/codeql-action/analyze v4 composite
  • github/codeql-action/autobuild v4 composite
  • github/codeql-action/init v4 composite
.github/workflows/push_gem.yml actions
  • actions/checkout 08c6903cd8c0fde910a37f88322edcfb5dd907a8 composite
  • ruby/setup-ruby d5126b9b3579e429dd52e51e68624dda2e05be25 composite
  • rubygems/release-gem 1c162a739e8b4cb21a676e97b087e8268d8fc40b composite
  • step-security/harden-runner 95d9a5deda9de15063e7595e9719c11c38c90ae2 composite
.github/workflows/sync-ruby.yml actions
  • actions/checkout v5 composite
  • actions/create-github-app-token v2 composite
  • convictional/trigger-workflow-and-wait v1.6.5 composite
optparse.gemspec rubygems

Score: 30.683272032496536