Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # -*- coding: utf-8 -*-
- require 'optparse'
- require 'pp'
- options = {}
- opts = OptionParser.new do |opts|
- opts.banner = "Usage: #{$0} [options]"
- opts.on( '--team v', 'This is the team' ) do |v|
- options[:team] = v
- end
- opts.on( '--status v', 'Status of the Team' ) do |v|
- options[:time] = v
- end
- # ...
- # Options for running this Script
- # ...
- options[:verbose] = false
- opts.on( '-v', '--verbose', 'Output more information' ) do
- options[:verbose] = true
- end
- opts.on( '-h', '--help', 'Display this screen' ) do
- puts opts
- exit
- end
- end
- opts.parse!
- if options[:verbose]
- pp "Options:", options
- end
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement