Class: Toys::StandardMiddleware::AddVerbosityFlags
- Inherits:
-
Object
- Object
- Toys::StandardMiddleware::AddVerbosityFlags
- Defined in:
- lib/toys/standard_middleware/add_verbosity_flags.rb
Overview
A middleware that provides flags for editing the verbosity.
This middleware adds -v
, --verbose
, -q
, and --quiet
flags, if
not already defined by the tool. These flags affect the setting of
Context::Key::VERBOSITY, and, thus, the logger level.
Constant Summary collapse
- DEFAULT_VERBOSE_FLAGS =
Default verbose flags
["-v", "--verbose"].freeze
- DEFAULT_QUIET_FLAGS =
Default quiet flags
["-q", "--quiet"].freeze
Instance Method Summary collapse
-
#initialize(verbose_flags: true, quiet_flags: true) ⇒ AddVerbosityFlags
constructor
Create a AddVerbosityFlags middleware.
Constructor Details
#initialize(verbose_flags: true, quiet_flags: true) ⇒ AddVerbosityFlags
Create a AddVerbosityFlags middleware.
44 45 46 47 |
# File 'lib/toys/standard_middleware/add_verbosity_flags.rb', line 44 def initialize(verbose_flags: true, quiet_flags: true) @verbose_flags = verbose_flags @quiet_flags = quiet_flags end |