Add quiet mode
Only log errors
This commit is contained in:
@@ -8,6 +8,7 @@ module Mrsk::Cli
|
||||
def self.exit_on_failure?() true end
|
||||
|
||||
class_option :verbose, type: :boolean, aliases: "-v", desc: "Detailed logging"
|
||||
class_option :quiet, type: :boolean, aliases: "-q", desc: "Minimal logging"
|
||||
|
||||
class_option :version, desc: "Run commands against a specific app version"
|
||||
|
||||
@@ -35,8 +36,12 @@ module Mrsk::Cli
|
||||
commander.specific_primary! if options[:primary]
|
||||
|
||||
if options[:verbose]
|
||||
commander.verbose = true
|
||||
ENV["VERBOSE"] = "1" # For backtraces via cli/start
|
||||
ENV["VERBOSE"] = "1" # For backtraces via cli/start
|
||||
commander.verbosity = :debug
|
||||
end
|
||||
|
||||
if options[:quiet]
|
||||
commander.verbosity = :error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,13 +13,13 @@ class Mrsk::Cli::Build < Mrsk::Cli::Base
|
||||
|
||||
run_locally do
|
||||
begin
|
||||
MRSK.verbosity(:debug) { execute *MRSK.builder.push }
|
||||
MRSK.with_verbosity(:debug) { execute *MRSK.builder.push }
|
||||
rescue SSHKit::Command::Failed => e
|
||||
if e.message =~ /(no builder)|(no such file or directory)/
|
||||
error "Missing compatible builder, so creating a new one first"
|
||||
|
||||
if cli.create
|
||||
MRSK.verbosity(:debug) { execute *MRSK.builder.push }
|
||||
MRSK.with_verbosity(:debug) { execute *MRSK.builder.push }
|
||||
end
|
||||
else
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user