{"id":15032851,"url":"https://github.com/ruby/getoptlong","last_synced_at":"2025-10-19T22:32:04.910Z","repository":{"id":37096728,"uuid":"200772613","full_name":"ruby/getoptlong","owner":"ruby","description":"The GetoptLong class allows you to parse command line options similarly to the GNU getopt_long() C library call.","archived":false,"fork":false,"pushed_at":"2025-08-18T07:26:52.000Z","size":62,"stargazers_count":7,"open_issues_count":1,"forks_count":9,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-10-09T12:14:11.536Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-06T03:52:48.000Z","updated_at":"2025-08-18T07:26:54.000Z","dependencies_parsed_at":"2023-11-07T05:43:47.410Z","dependency_job_id":"1f137e29-02b1-47b5-9690-814225c10b9b","html_url":"https://github.com/ruby/getoptlong","commit_stats":{"total_commits":61,"total_committers":21,"mean_commits":"2.9047619047619047","dds":0.639344262295082,"last_synced_commit":"64c00e26514ecdbe2b7607ce25f161f890501476"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ruby/getoptlong","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgetoptlong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgetoptlong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgetoptlong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgetoptlong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/getoptlong/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgetoptlong/sbom","scorecard":{"id":788915,"data":{"date":"2025-08-11","repo":{"name":"github.com/ruby/getoptlong","commit":"f49629dfaa17b2dbb8c776ff9bf52ef8a050c19a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 6/23 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/ruby/getoptlong/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/ruby/getoptlong/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/ruby/getoptlong/test.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T06:54:03.436Z","repository_id":37096728,"created_at":"2025-08-23T06:54:03.436Z","updated_at":"2025-08-23T06:54:03.436Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021780,"owners_count":26087055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-09-24T20:19:36.041Z","updated_at":"2025-10-19T22:32:04.582Z","avatar_url":"https://github.com/ruby.png","language":"Ruby","readme":"# Getoptlong\n\nThe GetoptLong class allows you to parse command line options similarly to\nthe GNU getopt_long() C library call. Note, however, that GetoptLong is a\npure Ruby implementation.\n\nGetoptLong allows for POSIX-style options like \u003ctt\u003e--file\u003c/tt\u003e as well\nas single letter options like \u003ctt\u003e-f\u003c/tt\u003e\n\nThe empty option \u003ctt\u003e--\u003c/tt\u003e (two minus symbols) is used to end option\nprocessing. This can be particularly important if options have optional\narguments.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'getoptlong'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install getoptlong\n\n## Usage\n\n```ruby\nrequire 'getoptlong'\n\nopts = GetoptLong.new(\n  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],\n  [ '--repeat', '-n', GetoptLong::REQUIRED_ARGUMENT ],\n  [ '--name', GetoptLong::OPTIONAL_ARGUMENT ]\n)\n\ndir = nil\nname = nil\nrepetitions = 1\nopts.each do |opt, arg|\n  case opt\n    when '--help'\n      puts \u003c\u003c-EOF\nhello [OPTION] ... DIR\n-h, --help:\n   show help\n--repeat x, -n x:\n   repeat x times\n--name [name]:\n   greet user by name, if name not supplied default is John\nDIR: The directory in which to issue the greeting.\n      EOF\n    when '--repeat'\n      repetitions = arg.to_i\n    when '--name'\n      if arg == ''\n        name = 'John'\n      else\n        name = arg\n      end\n  end\nend\n\nif ARGV.length != 1\n  puts \"Missing dir argument (try --help)\"\n  exit 0\nend\n\ndir = ARGV.shift\n\nDir.chdir(dir)\nfor i in (1..repetitions)\n  print \"Hello\"\n  if name\n    print \", #{name}\"\n  end\n  puts\nend\n```\n\nExample command line:\n\n```\nhello -n 6 --name -- /tmp\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ruby/getoptlong.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fgetoptlong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fgetoptlong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fgetoptlong/lists"}