Advertisement
Guest User

Untitled

a guest
Dec 12th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.73 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. # -*- coding: utf-8 -*-
  3. require 'optparse'
  4. require 'pp'
  5.  
  6. options = {}
  7. opts = OptionParser.new do |opts|
  8.     opts.banner = "Usage: #{$0} [options]"
  9.     opts.on( '--team v', 'This is the team' ) do |v|
  10.         options[:team] = v
  11.     end
  12.     opts.on( '--status v', 'Status of the Team' ) do |v|
  13.         options[:time] = v
  14.     end
  15.     # ...
  16.     # Options for running this Script
  17.     # ...
  18.     options[:verbose] = false
  19.     opts.on( '-v', '--verbose', 'Output more information' ) do
  20.         options[:verbose] = true
  21.     end
  22.     opts.on( '-h', '--help', 'Display this screen' ) do
  23.         puts opts
  24.         exit
  25.     end
  26. end
  27.  
  28. opts.parse!
  29.  
  30. if options[:verbose]
  31.     pp "Options:", options
  32. end
  33.  
  34. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement