Module: Bashly::Completions

Included in:
Models::Command
Defined in:
lib/bashly/concerns/completions.rb

Overview

This is a ‘Command` concern responsible for providing bash completion data

Instance Method Summary collapse

Instance Method Details

#completion_data(with_version: true) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/bashly/concerns/completions.rb', line 6

def completion_data(with_version: true)
  result = { full_name => completion_words(with_version: with_version) }
  
  commands.each do |command|
    result.merge! command.completion_data(with_version: false)
  end

  result
end

#completion_function(name = nil) ⇒ Object



20
21
22
# File 'lib/bashly/concerns/completions.rb', line 20

def completion_function(name = nil)
  completion_generator.wrapper_function(name)
end

#completion_scriptObject



16
17
18
# File 'lib/bashly/concerns/completions.rb', line 16

def completion_script
  completion_generator.script
end