Method: Hanami::CLI::Command#initialize

Defined in:
lib/hanami/cli/command.rb

#initialize(out:, err:, fs:) ⇒ Command

Returns a new command.

This method does not need to be called directly when creating commands for the CLI. Commands are registered as classes, and the CLI framework will initialize the command when needed. This means that all parameters for #initialize should also be given default arguments. See new for the standard default arguments for all commands.

Parameters:

  • out (IO)

    I/O stream for standard command output

  • err (IO)

    I/O stream for comment errror output

  • fs (Hanami::CLI::Files)

    object for managing file system interactions

  • inflector (Dry::Inflector)

    inflector for any command-level inflections

See Also:

Since:

  • 2.0.0



48
49
50
51
52
53
# File 'lib/hanami/cli/command.rb', line 48

def initialize(out:, err:, fs:)
  super()
  @out = out
  @err = err
  @fs = fs
end