Created
January 17, 2015 23:22
-
-
Save sepulworld/00a79d406866774bd9ab to your computer and use it in GitHub Desktop.
Ruby Script Starter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'optparse' | |
options = {} | |
parser = OptionParser.new do |opts| | |
opts.banner = "Usage: <script_name> [options]" | |
options[:firstoption] = 20 | |
opts.on("-t <integer>", "--secondoption", "Number of HTTP request threads to generate") do |t| | |
options[:secondoption] = t | |
end | |
opts.on("-p <string>", "--thirdoption", "Description of third option") do |p| | |
options[:thirdoption] = p | |
end | |
opts.on("-d <directory value>", "--product_dir", "Description of product_dir option") do |d| | |
options[:product_dir] = d | |
end | |
opts.on("-c <remote url>", "--remote_url", "Put nice little description here") do |c| | |
options[:remote_url] = c | |
end | |
opts.on("-v", "--verbose", "Output is verbose") do |v| | |
options[:verbose] = v | |
end | |
opts.on('-h', '--help', 'Displays Help') do | |
puts opts | |
exit | |
end | |
end | |
parser.parse! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment