Class: Indoctrinatr::Tools::Commands::ZshCompletions

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/indoctrinatr/tools/commands/zsh_completions.rb

Instance Method Summary collapse

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/indoctrinatr/tools/commands/zsh_completions.rb', line 7

def call(**)
  puts <<~HEREDOC
    Add this to your .zshrc (and open up a new shell):

    if [[ -n ${ZSH_VERSION-} ]]; then
      autoload -U +X bashcompinit && bashcompinit
    fi
    complete -F get_indoctrinatr_commands indoctrinatr
    function get_indoctrinatr_commands()
    {
      local binary="indoctrinatr"
      COMPREPLY=(`$binary completions`)
    }
  HEREDOC
end