Module: Dry::CLI::Help
- Defined in:
- lib/dry/cli/help.rb,
lib/dry/cli/help/text.rb,
lib/dry/cli/help/colors.rb,
lib/dry/cli/help/version.rb,
lib/dry/cli/help/terminal.rb,
lib/dry/cli/help/formatter.rb,
lib/dry/cli/help/integration.rb,
lib/dry/cli/help/screens/base.rb,
lib/dry/cli/help/configuration.rb,
lib/dry/cli/help/screens/command.rb,
lib/dry/cli/help/screens/listing.rb,
sig/dry/cli/help.rbs
Overview
Configurable, wrapped and colored help screens for dry-cli.
Requiring this file changes the help every Dry::CLI in the process prints. Every setting is made once, in Help.configure, so the way dry-cli declares registries, commands and options stays exactly as dry-cli ships it.
Defined Under Namespace
Modules: Colors, Integration, Screens, Terminal, Text Classes: Configuration, Formatter
Constant Summary collapse
- VERSION =
"0.5.1"
Class Method Summary collapse
-
.config ⇒ Configuration
The process-wide settings.
- .config_for ⇒ Configuration
-
.configure {|arg0| ... } ⇒ Configuration
Make every setting.
-
.reset! ⇒ void
Forget every process-wide setting.
Class Method Details
.config ⇒ Configuration
Returns the process-wide settings.
42 43 44 |
# File 'lib/dry/cli/help.rb', line 42 def config @config ||= Configuration.new end |
.config_for ⇒ Configuration
9 |
# File 'sig/dry/cli/help.rbs', line 9
def self.config_for: (untyped registry) -> Configuration
|
.configure {|arg0| ... } ⇒ Configuration
Make every setting. A block taking an argument receives the configuration; any other block runs against it.
36 37 38 39 |
# File 'lib/dry/cli/help.rb', line 36 def configure(&block) block.arity == 1 ? yield(config) : config.instance_eval(&block) config end |
.reset! ⇒ void
This method returns an undefined value.
Forget every process-wide setting.
48 49 50 |
# File 'lib/dry/cli/help.rb', line 48 def reset! @config = nil end |