Class: Agent::Lock::CLI::Commands::Base Abstract
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Agent::Lock::CLI::Commands::Base
- Defined in:
- lib/agent/lock/cli/commands/base.rb
Overview
Subclass and implement #call(**options).
What every command shares: the launcher it prints through, the manager it delegates to, and the wording of a held lock.
Nothing here calls puts or exit. Output goes to the launcher's
streams and the exit code is handed back to it, which is what lets
the whole CLI run inside the test process.
Commands that read or write a lock store subclass TreeCommand
instead, which adds --dir. The rest (version, whoami,
skills) never look at a tree, so offering them --dir would be
a flag that silently does nothing.
Direct Known Subclasses
Show, SkillsInstall, SkillsPath, SwitchBackend, TreeCommand, Version, Whoami
Instance Attribute Summary collapse
-
#launcher ⇒ Launcher
readonly
The streams, program name and exit code holder.
Instance Method Summary collapse
-
#initialize(launcher = nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(launcher = nil) ⇒ Base
Returns a new instance of Base.
31 32 33 34 |
# File 'lib/agent/lock/cli/commands/base.rb', line 31 def initialize(launcher = nil) super() @launcher = launcher end |
Instance Attribute Details
#launcher ⇒ Launcher (readonly)
Returns the streams, program name and exit code holder.
28 29 30 |
# File 'lib/agent/lock/cli/commands/base.rb', line 28 def launcher @launcher end |