Class: Agent::Lock::CLI::Commands::Base
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Agent::Lock::CLI::Commands::Base
- Defined in:
- lib/agent/lock/cli/commands/base.rb
Overview
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.
Direct Known Subclasses
Acquire, Break, Check, List, Mine, Note, Release, ReleaseAll, Resume, SkillInstall, SkillPath, Version, Whoami
Instance Attribute Summary collapse
-
#launcher ⇒ Object
readonly
Returns the value of attribute launcher.
Class Method Summary collapse
-
.inherited(subclass) ⇒ Object
Inherited by every command, so
--dirworks everywhere without each one restating it.
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.
30 31 32 33 |
# File 'lib/agent/lock/cli/commands/base.rb', line 30 def initialize(launcher = nil) super() @launcher = launcher end |
Instance Attribute Details
#launcher ⇒ Object (readonly)
Returns the value of attribute launcher.
27 28 29 |
# File 'lib/agent/lock/cli/commands/base.rb', line 27 def launcher @launcher end |
Class Method Details
.inherited(subclass) ⇒ Object
Inherited by every command, so --dir works everywhere without
each one restating it.
21 22 23 24 25 |
# File 'lib/agent/lock/cli/commands/base.rb', line 21 def self.inherited(subclass) super subclass.option :dir, type: :string, default: ".", desc: "Work as if run from this directory" end |