Class: Clamp::Completion::ZshGenerator
- Inherits:
-
Object
- Object
- Clamp::Completion::ZshGenerator
- Defined in:
- lib/clamp/completion/zsh_generator.rb
Overview
Generates zsh shell completion scripts.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(command_class, executable_name) ⇒ ZshGenerator
constructor
A new instance of ZshGenerator.
Constructor Details
#initialize(command_class, executable_name) ⇒ ZshGenerator
Returns a new instance of ZshGenerator.
10 11 12 13 |
# File 'lib/clamp/completion/zsh_generator.rb', line 10 def initialize(command_class, executable_name) @command_class = command_class @executable_name = executable_name end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 |
# File 'lib/clamp/completion/zsh_generator.rb', line 15 def generate lines = ["#compdef #{@executable_name}", ""] generate_functions(lines, @command_class, [function_name], Set.new) lines << "_#{function_name}" lines.push("").join("\n") end |