Class: Agent::Lock::CLI::Commands::Completion

Inherits:
Dry::CLI::Autocomplete::Command
  • Object
show all
Defined in:
lib/agent/lock/cli/commands/completion.rb

Overview

alock completion bash|zsh, from dry-cli-autocomplete.

Upstream binds a registry by subclassing this command, restores the description and examples dry-cli's inherited hook clears, and writes to the stream dry-cli hands it. All that is left to say here is the wording, and where a Homebrew bash keeps its completions.

Class Method Summary collapse

Class Method Details

.examples_for(name) ⇒ Array<String>

Upstream calls this from inside the subclass it builds, so overriding it here changes the examples --help prints.

Parameters:

  • name (String) —

    the program the script completes

Returns:

  • (Array<String>)


23
24
25
26
27
28
# File 'lib/agent/lock/cli/commands/completion.rb', line 23

def self.examples_for(name)
  [
    "bash > \"$(brew --prefix)/etc/bash_completion.d/#{name}\"",
    "zsh  > \"${fpath[1]}/_#{name}\""
  ]
end