Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'optparse'
- # create an empty hash to hold the options
- options = {}
- optparse = OptionParser.new do|opts|
- opts.banner = "Usage: shift_subtitle [options] file1 file2"
- opts.on('-h', '--help', 'Display this screen') do
- puts opts
- exit
- end
- opts.on('-o', '--operation STR', 'What type of operation to use') do|o|
- options[:operation] = o
- end
- opts.on('-t', '--time NUM', 'Amount of time to shift') do|t|
- options[:time] = t
- end
- end
- optparse.parse!
- options[:file1] = ARGV[0] if ARGV[0]
- options[:file2] = ARGV[1] if ARGV[1]
Advertisement
Add Comment
Please, Sign In to add comment