bin/domain_check in domain_check-0.0.2 vs bin/domain_check in domain_check-0.0.3

- old
+ new

@@ -2,11 +2,13 @@ require 'domain_check' require 'date' require 'optparse' -options = { } +options = { } +format_options = { } + opt_parser = OptionParser.new do |opts| opts.banner = "Usage: domain_check [options]" opts.separator "" opts.separator "Specific options:" @@ -33,17 +35,21 @@ opts.on("-t", "--tlds TLD1,TLD2,...", "Create domain names with each of the TLDs and check them") do |tlds| options[:tlds] = tlds.split(/,/) end + opts.on("-a", "--available-only", "Only show available domains") do |available| + format_options[:available_only] = available + end + opts.on_tail("-?", "--help", "Show this message") do puts opts exit end end opt_parser.parse!(ARGV) DomainCheck.new(**options).check do |result| - formatter = DomainCheck::ConsoleFormatter.new(result) + formatter = DomainCheck::ConsoleFormatter.new(result, format_options[:available_only]) formatter.format end