def run
if options.autocomplete
src = File.join(File.join(Gem.loaded_specs['rhc'].full_gem_path, "autocomplete"), "rhc_bash")
dest = File.join(RHC::Config.home_conf_dir, "bash_autocomplete")
FileUtils.mkdir_p(RHC::Config.home_conf_dir)
FileUtils.cp(src, dest)
say "To enable tab-completion for RHC under Bash shells, add the following command to\nyour .bashrc or .bash_profile file:\n\n. \#{dest}\n\nSave your shell and then restart. Type \"rhc\" and then hit the TAB key twice to\ntrigger completion of your command.\n\nTab-completion is not available in the Windows terminal.\n".strip_heredoc
return 0
end
raise OptionParser::InvalidOption, "Setup can not be run with the --noprompt option" if options.noprompt
RHC::RerunWizard.new(config, options).run ? 0 : 1
end