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.

gem install optparse
INSTALL
IMPORT
SIG · OPTPARSE
O
optparse
clirubyv0.8.1
harness data pending
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.

OptionParser
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 issues

No known issues recorded.

Upgrade
Version history
0.8.1latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
optparse — gem install optparse · libregistry