Class: Completion::Command::Uninstall

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/completion/command/uninstall.rb

Overview

Uninstall a shell completion adapter script from a user-local completion directory.

Instance Method Summary collapse

Instance Method Details

#callObject

Remove the installed shell adapter script.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/completion/command/uninstall.rb', line 26

def call
	shell = @options[:shell]
	
	if @options[:all]
		return uninstall_all(shell)
	end
	
	directory = Shell.adapter_directory(shell, @options[:command], directory: @options[:directory])
	path = File.join(directory, Shell.file_name(shell, @options[:command]))
	
	File.delete(path) if File.exist?(path)
	
	output.puts path
end