Class: Dry::CLI::Help::Screens::Command

Inherits:
Base
  • Object
show all
Defined in:
lib/dry/cli/help/screens/command.rb

Overview

The help printed for one command: mycli deploy -h.

Constant Summary collapse

SECTIONS =
%i[banner usage description subcommands arguments options examples epilogue].freeze

Constants inherited from Base

Base::HELP, Base::INDENT, Base::Row

Instance Method Summary collapse

Methods inherited from Base

#render

Constructor Details

#initialize(command:, prog_name:, top_level: false) ⇒ Command

Returns a new instance of Command.

Parameters:

  • command (Class, Dry::CLI::Command)
  • prog_name (String) —

    the program and command path, "mycli db migrate"

  • top_level (Boolean) (defaults to: false) —

    true when the command is the whole CLI, as with Dry::CLI.new(SomeCommand)



15
16
17
18
19
20
# File 'lib/dry/cli/help/screens/command.rb', line 15

def initialize(command:, prog_name:, top_level: false, **)
  super(**)
  @command = command
  @prog_name = prog_name
  @top_level = top_level
end