mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-29 16:16:06 +00:00
add --exclude filter
- add exclude filter. Has precedence over the --only filter. - bumped the version. - tests: I modified the tests, but.. the whole suite is hopelessly broken. And when I say hopeless, I'm talking about myself; my Ruby is so rudimentary I was looking up how to create a variable. It really needs a static list of the website 'contents' mocked into it. I have a branch in my repo showing my hopeless work.
This commit is contained in:
@@ -22,13 +22,17 @@ option_parser = OptionParser.new do |opts|
|
||||
options[:only_filter] = t
|
||||
end
|
||||
|
||||
opts.on("-x", "--exclude EXCLUDE_FILTER", String, "Skip urls that match this filter (use // notation for the filter to be treated as a regex)") do |t|
|
||||
options[:exclude_filter] = t
|
||||
end
|
||||
|
||||
opts.on("-v", "--version", "Display version") do |t|
|
||||
options[:version] = t
|
||||
end
|
||||
end.parse!
|
||||
|
||||
if (base_url = ARGV[-1])
|
||||
wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp], only_filter: options[:only_filter]
|
||||
wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp], only_filter: options[:only_filter], exclude_filter: options[:exclude_filter]
|
||||
wayback_machine_downloader.download_files
|
||||
elsif options[:version]
|
||||
puts WaybackMachineDownloader::VERSION
|
||||
|
||||
Reference in New Issue
Block a user