Class: RosettAi::Completion::Shells::FishGenerator
- Inherits:
-
Object
- Object
- RosettAi::Completion::Shells::FishGenerator
- Defined in:
- lib/rosett_ai/completion/shells/fish_generator.rb
Overview
Generates fish completion scripts from the Thor command tree.
Uses fish's complete builtin with condition-based subcommand
completion. Supports subcommand descriptions and dynamic
completions for behaviour/engine names.
Instance Method Summary collapse
-
#generate ⇒ String
Fish completion script.
-
#initialize(command_tree) ⇒ FishGenerator
constructor
A new instance of FishGenerator.
Constructor Details
#initialize(command_tree) ⇒ FishGenerator
Returns a new instance of FishGenerator.
19 20 21 |
# File 'lib/rosett_ai/completion/shells/fish_generator.rb', line 19 def initialize(command_tree) @command_tree = command_tree end |
Instance Method Details
#generate ⇒ String
Returns fish completion script.
24 25 26 27 28 29 30 31 |
# File 'lib/rosett_ai/completion/shells/fish_generator.rb', line 24 def generate lines = [] lines << header lines << disable_file_completion lines << top_level_completions lines << subcommand_completions lines.join("\n") end |