lib/longleaf/cli.rb in longleaf-0.1.0.pre.2 vs lib/longleaf/cli.rb in longleaf-0.1.0.pre.3
- old
+ new
@@ -9,10 +9,11 @@
class CLI < Thor
include Longleaf::Logging
class_option(:config, :aliases => "-c",
:default => ENV['LONGLEAF_CFG'],
+ :required => true,
:desc => 'Absolute path to the application configuration used for this command. By default, the value of the environment variable LONGLEAF_CFG is used.')
# Logging/output options
class_option(:failure_only,
:type => :boolean,
:default => false,
@@ -56,15 +57,15 @@
command = Longleaf::RegisterCommand.new(config_path)
exit command.execute(file_paths: file_paths, force: options[:force], checksums: checksums)
end
- desc "validate_config [CONFIG_PATH]", "Validate an application configuration file"
+ desc "validate_config", "Validate an application configuration file, provided using --config."
# Application configuration validation command
- def validate_config(config_path)
+ def validate_config
setup_logger(options)
- exit Longleaf::ValidateConfigCommand.new(config_path).execute
+ exit Longleaf::ValidateConfigCommand.new(options[:config]).execute
end
no_commands do
def setup_logger(options)
initialize_logger(options[:failure_only],
\ No newline at end of file