lib/goodcheck/cli.rb in goodcheck-2.7.0 vs lib/goodcheck/cli.rb in goodcheck-3.0.0
- old
+ new
@@ -19,12 +19,10 @@
pattern: "Print regexp for rules",
version: "Print version",
help: "Show help and quit"
}.freeze
- DEFAULT_CONFIG_FILE = Pathname("goodcheck.yml").freeze
-
def run(args)
command = args.shift&.to_sym
if COMMANDS.key?(command)
__send__(command, args)
@@ -56,11 +54,11 @@
Pathname(Dir.home) + ".goodcheck"
end
end
def check(args)
- config_path = DEFAULT_CONFIG_FILE
+ config_path = Pathname(DEFAULT_CONFIG_FILE)
targets = []
rules = []
formats = [:text, :json]
format = :text
loglevel = nil
@@ -108,11 +106,11 @@
Commands::Check.new(reporter: reporter, config_path: config_path, rules: rules, targets: targets, stderr: stderr, force_download: force_download, home_path: home_path).run
end
def test(args)
- config_path = DEFAULT_CONFIG_FILE
+ config_path = Pathname(DEFAULT_CONFIG_FILE)
loglevel = ::Logger::ERROR
force_download = false
OptionParser.new("Usage: goodcheck test [options]") do |opts|
config_option(opts) { |config| config_path = config }
@@ -130,11 +128,11 @@
Commands::Test.new(stdout: stdout, stderr: stderr, config_path: config_path, force_download: force_download, home_path: home_path).run
end
def init(args)
- config_path = DEFAULT_CONFIG_FILE
+ config_path = Pathname(DEFAULT_CONFIG_FILE)
force = false
OptionParser.new("Usage: goodcheck init [options]") do |opts|
config_option(opts) { |config| config_path = config }
common_options(opts)
@@ -161,10 +159,10 @@
end
EXIT_SUCCESS
end
def pattern(args)
- config_path = DEFAULT_CONFIG_FILE
+ config_path = Pathname(DEFAULT_CONFIG_FILE)
OptionParser.new do |opts|
opts.banner = "Usage: goodcheck pattern [options] ids..."
config_option(opts) { |config| config_path = config }
common_options(opts)