Class: Ppl::Command::Completion

Inherits:
Application::Command show all
Defined in:
lib/ppl/command/completion.rb

Instance Attribute Summary collapse

Attributes inherited from Application::Command

#storage

Instance Method Summary collapse

Methods inherited from Application::Command

add_property

Instance Attribute Details

#completions_directory=(value) ⇒ Object (writeonly)

Sets the attribute completions_directory

Parameters:

  • value

    the value to set the attribute completions_directory to.



7
8
9
# File 'lib/ppl/command/completion.rb', line 7

def completions_directory=(value)
  @completions_directory = value
end

Instance Method Details

#execute(input, output) ⇒ Object



13
14
15
16
17
# File 'lib/ppl/command/completion.rb', line 13

def execute(input, output)
  shell_name = require_shell_name(input)
  location = require_completion_existence(shell_name)
  output.line(File.read(location))
end

#options(parser, options) ⇒ Object



9
10
11
# File 'lib/ppl/command/completion.rb', line 9

def options(parser, options)
  parser.banner = "usage: ppl completion <shell>"
end