Class: RosettAi::Completion::Shells::ZshGenerator
- Inherits:
-
Object
- Object
- RosettAi::Completion::Shells::ZshGenerator
- Defined in:
- lib/rosett_ai/completion/shells/zsh_generator.rb
Overview
Generates zsh completion scripts from the Thor command tree.
Uses zsh compdef system with _raictl function and _arguments helper. Supports subcommand descriptions shown during tab completion.
Instance Method Summary collapse
-
#generate ⇒ String
Zsh completion script.
-
#initialize(command_tree) ⇒ ZshGenerator
constructor
A new instance of ZshGenerator.
Constructor Details
#initialize(command_tree) ⇒ ZshGenerator
Returns a new instance of ZshGenerator.
18 19 20 |
# File 'lib/rosett_ai/completion/shells/zsh_generator.rb', line 18 def initialize(command_tree) @command_tree = command_tree end |
Instance Method Details
#generate ⇒ String
Returns zsh completion script.
23 24 25 26 27 28 29 30 |
# File 'lib/rosett_ai/completion/shells/zsh_generator.rb', line 23 def generate lines = [] lines << header lines << main_function lines << subcommand_functions lines << registration lines.join("\n") end |