Class: Herve::CLI::ShellCommands::Completion
- Inherits:
-
BaseCommand
- Object
- Dry::CLI::Command
- BaseCommand
- Herve::CLI::ShellCommands::Completion
- Defined in:
- lib/herve/cli/shell_commands/completion.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
Methods inherited from BaseCommand
Instance Method Details
#call(shell:, **_args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/herve/cli/shell_commands/completion.rb', line 12 def call(shell:, **_args) raise Error, "unsupported shell '#{shell}'" unless SUPPORTED_SHELLS.include?(shell) if shell == "zsh" puts "autoload -Uz +X compinit && compinit" puts "autoload -Uz +X bashcompinit && bashcompinit" end puts Completely::Completions.new(generate_completion_data).script end |