Class: Agent::Lock::CLI::Commands::Completion
- Inherits:
-
Dry::CLI::Autocomplete::Command
- Object
- Dry::CLI::Autocomplete::Command
- Agent::Lock::CLI::Commands::Completion
- Defined in:
- lib/agent/lock/cli/commands/completion.rb
Overview
alock completion bash|zsh, from dry-cli-autocomplete, with the two
things that gem's command cannot do for us restated here.
It writes to $stdout directly, which the in-process launcher can
neither capture nor redirect, and it binds a registry by way of
Class.new, which is exactly where dry-cli clears an inherited
desc and example. Both belong upstream; until then, here.
Class Method Summary collapse
-
.[](registry, program_name: nil) ⇒ Class
Binding a registry subclasses this command, and dry-cli's
inheritedhook starts every subclass with no description and no examples.
Class Method Details
.[](registry, program_name: nil) ⇒ Class
Binding a registry subclasses this command, and dry-cli's
inherited hook starts every subclass with no description and no
examples. Arguments and options survive it; those two do not, so
they are copied across by hand.
34 35 36 37 38 39 |
# File 'lib/agent/lock/cli/commands/completion.rb', line 34 def self.[](registry, program_name: nil) super.tap do |bound| bound.desc(description) bound.example(*examples) end end |