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.



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

def completions_directory=(value)
  @completions_directory = value
end

Instance Method Details

#execute(input, output) ⇒ Object



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

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



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

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