Class: Autoproj::BashCompletion

Inherits:
ShellCompletion show all
Defined in:
lib/autoproj/bash_completion.rb

Overview

This class generates shell completion for code for a given Thor subclasss

Constant Summary collapse

MAIN_FUNCTION_TEMPLATE =
"main.bash.erb"
SUBCOMMAND_FUNCTION_TEMPLATE =
"subcommand.bash.erb"

Constants inherited from ShellCompletion

ShellCompletion::TEMPLATES_DIR

Instance Attribute Summary

Attributes inherited from ShellCompletion

#cli, #cli_metadata, #name

Instance Method Summary collapse

Methods inherited from ShellCompletion

#generate, #generate_command_metadata, #generate_metadata, #hyphenate, #initialize, #options_metadata, #populate_help_subcommands, #render_subcommand_function, #setup_completion_functions, #subcommand_by_name, #subcommand_metadata

Constructor Details

This class inherits a constructor from Autoproj::ShellCompletion

Instance Method Details

#disable_completion(metadata) ⇒ Object



21
22
23
# File 'lib/autoproj/bash_completion.rb', line 21

def disable_completion()
    [:completer] = nil
end

#setup_executable_completion(metadata) ⇒ Object



13
14
15
# File 'lib/autoproj/bash_completion.rb', line 13

def setup_executable_completion()
    [:completer] = 'COMPREPLY=( $( compgen -d -c -- "$cur" ) )'
end

#setup_file_completion(metadata) ⇒ Object



9
10
11
# File 'lib/autoproj/bash_completion.rb', line 9

def setup_file_completion()
    [:completer] = "_filedir"
end

#setup_package_completion(metadata) ⇒ Object



17
18
19
# File 'lib/autoproj/bash_completion.rb', line 17

def setup_package_completion()
    [:completer] = "_autoproj_installed_packages"
end