diff --git a/bin/wayback_machine_downloader b/bin/wayback_machine_downloader index c4ef13f..0c35648 100755 --- a/bin/wayback_machine_downloader +++ b/bin/wayback_machine_downloader @@ -18,8 +18,8 @@ option_parser = OptionParser.new do |opts| options[:timestamp] = t end - opts.on("--accept-regex [ACCEPT_REGEX]", String,"Specify a regular expression to download. If a path doesn't meet this regex, it won't get downloaded.") do |accept_regex| - options[:accept_regex] = accept_regex + opts.on("-o", "--only ONLY_FILTER", String, "Restrict downloading to file urls matching the only filter supplied (use // notation for the only filter to be treated as a regex)") do |t| + options[:only_filter] = t end opts.on("-v", "--version", "Display version") do |t| @@ -27,11 +27,8 @@ option_parser = OptionParser.new do |opts| end end.parse! -# this used to be 0. we want to look at the /last/ option. -# -# TODO: this argument needs to be handled better. argument handling is sorta messy. if base_url = ARGV[-1] - wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp], accept_regex: options[:accept_regex] + wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp], only_filter: options[:only_filter] wayback_machine_downloader.download_files elsif options[:version] puts WaybackMachineDownloader::VERSION