Registry / cli / optparse

optparse

JSON →
library0.8.1rbrubygemsunverified

OptionParser is a class for command-line option analysis, providing a more advanced and Ruby-oriented solution than GetoptLong.

cli
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

require 'optparse'

Parses command-line options using OptionParser.

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! puts "Verbose: #{options[:verbose]}"
Debug
Known footguns

No known footguns recorded.

Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources