Class: Homebrew::Cmd::CompletionsCmd

Inherits:
AbstractCommand show all
Defined in:
cmd/completions.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'cmd/completions.rb', line 26

def run
  case args.named.first
  when nil, "state"
    if Completions.link_completions?
      puts "Completions are linked."
    else
      puts "Completions are not linked."
    end
  when "link"
    Completions.link!
    puts "Completions are now linked."
  when "unlink"
    Completions.unlink!
    puts "Completions are no longer linked."
  else
    raise UsageError, "unknown subcommand: #{args.named.first}"
  end
end