+ # Default options.
+ options = { :continue => false }
+
+ # Parse the command-line options into the options hash.
+ opts = GetoptLong.new(["--continue", "-c", GetoptLong::NO_ARGUMENT],
+ ["--help", "-h", GetoptLong::NO_ARGUMENT])
+
+ opts.each do |opt, arg|
+ case opt
+ when '--help'
+ usage()
+ Kernel.exit(EXIT_SUCCESS)
+ when '--continue'
+ options[:continue] = true
+ end
+ end
+
+ # Warn about nonsensical options.
+ if options[:continue] and not (Configuration::DOWNLOAD_METHOD == :wget)
+ puts 'WARNING: The --continue flag does nothing unless DOWNLOAD_METHOD is :wget.'
+ end
+
+ # Note that GetoptLong steals its arguments from ARGV, so we don't need
+ # to take optional arguments into account when figuring out whether or not
+ # we were passed a URL.