mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-17 09:46:05 +00:00
Add option to display the gem version
This commit is contained in:
parent
54b8328694
commit
2fd1eb68d5
@ -16,11 +16,17 @@ option_parser = OptionParser.new do |opts|
|
|||||||
opts.on("-t", "--timestamp TIMESTAMP", Integer, "Only files on or before timestamp supplied (ie. 20150806225358)") do |t|
|
opts.on("-t", "--timestamp TIMESTAMP", Integer, "Only files on or before timestamp supplied (ie. 20150806225358)") do |t|
|
||||||
options[:timestamp] = t
|
options[:timestamp] = t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("-v", "--version", "Display version") do |t|
|
||||||
|
options[:version] = t
|
||||||
|
end
|
||||||
end.parse!
|
end.parse!
|
||||||
|
|
||||||
if base_url = ARGV[0]
|
if base_url = ARGV[0]
|
||||||
wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp]
|
wayback_machine_downloader = WaybackMachineDownloader.new base_url: base_url, timestamp: options[:timestamp]
|
||||||
wayback_machine_downloader.download_files
|
wayback_machine_downloader.download_files
|
||||||
|
elsif options[:version]
|
||||||
|
puts WaybackMachineDownloader::VERSION
|
||||||
else
|
else
|
||||||
puts "You need to specify a website to backup. (e.g., http://example.com)"
|
puts "You need to specify a website to backup. (e.g., http://example.com)"
|
||||||
puts "Run `wayback_machine_downloader --help` for more help."
|
puts "Run `wayback_machine_downloader --help` for more help."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user