Skip to content

Instantly share code, notes, and snippets.

@adam12
Created August 30, 2021 17:59
Show Gist options
  • Save adam12/aa71c6ef2331870bac83ad78b4a12f51 to your computer and use it in GitHub Desktop.
Save adam12/aa71c6ef2331870bac83ad78b4a12f51 to your computer and use it in GitHub Desktop.
adam@Adams-MacBook-Air ruby-playground % ruby irc-aug-30.rb --deltas path
{:deltas=>true}
["path"]
adam@Adams-MacBook-Air ruby-playground % ruby -v
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]
adam@Adams-MacBook-Air ruby-playground % cat irc-aug-30.rb
require 'optparse'
$options = {}
OptionParser.new do |opts|
opts.banner = "Usage: pagecount.rb [options] ArchivePath"
opts.on("-d", "--[no-]deltas", "Should use app delta optimization") do
$options[:deltas] = true
end
end.parse!
pp $options
pp ARGV
adam@Adams-MacBook-Air ruby-playground %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment