10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/disavow_tool/command_options.rb', line 10
def parse(args)
options = OpenStruct.new
options.library = []
options.whitelist = false
options.verbose = false
options.hardcore_verbose = false
options.network_requests = true
opt_parser = OptionParser.new do |opts|
opts.banner = "Usage: disavow_tool [options] --disavow file_1,file_2,file_3 --import file_1,file_2,file_3 [--whitelist file1,file2,file3]"
opts.separator ""
opts.separator "Requited options:"
opts.on("-d","--disavow file_1,file_2", Array, "Disavow files as exported from Google Search Console") do |file|
options.disavow_files = file
end
opts.on("-i","--import file_1,file_2", Array, "List of URLS to analyse. The file must have one URL per line") do |file|
options.import_files = file
end
opts.separator ""
opts.separator "Optional options:"
opts.on("-w", "--whitelist file1,file2,file3", Array, "Enter any number of whitelisted files",
"whitelisted files must have one URL per line") do |file|
options.whitelist = true
options.whitelist_files = file
end
opts.on("-v", "--verbose", "Vervose mode") do
options.verbose = true
end
opts.on("-t", "--no-titles", "Don't request tittles from websites thus making the command faster") do
options.network_requests = false
end
opts.on("-V", "--hardcore-vervose", "Print out even your mama") do
options.hardcore_verbose = true
options.verbose = true end
opts.separator ""
opts.separator "Common options:"
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
opts.on_tail("--version", "Show version") do
puts VERSION
exit
end
end
opt_parser.parse!(args)
check_arguments(options)
options
end
|