MCPcopy Create free account
hub / github.com/github/gh-aw / UninstallShellCompletion

Function UninstallShellCompletion

pkg/cli/shell_completion.go:385–409  ·  view source on GitHub ↗

UninstallShellCompletion uninstalls shell completion for the detected shell

(verbose bool)

Source from the content-addressed store, hash-verified

383
384// UninstallShellCompletion uninstalls shell completion for the detected shell
385func UninstallShellCompletion(verbose bool) error {
386 shellCompletionLog.Print("Starting shell completion uninstallation")
387
388 shellType := DetectShell()
389 shellCompletionLog.Printf("Detected shell type: %s", shellType)
390
391 if shellType == ShellUnknown {
392 return errors.New("could not detect shell type. Please uninstall completions manually")
393 }
394
395 fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Detected shell: %s", shellType)))
396
397 switch shellType {
398 case ShellBash:
399 return uninstallBashCompletion(verbose)
400 case ShellZsh:
401 return uninstallZshCompletion(verbose)
402 case ShellFish:
403 return uninstallFishCompletion(verbose)
404 case ShellPowerShell:
405 return uninstallPowerShellCompletion(verbose)
406 default:
407 return fmt.Errorf("shell completion not supported for: %s", shellType)
408 }
409}
410
411// uninstallBashCompletion uninstalls bash completion
412func uninstallBashCompletion(verbose bool) error {

Callers 2

NewCompletionCommandFunction · 0.85

Calls 9

FormatInfoMessageFunction · 0.92
DetectShellFunction · 0.85
uninstallBashCompletionFunction · 0.85
uninstallZshCompletionFunction · 0.85
uninstallFishCompletionFunction · 0.85
PrintMethod · 0.80
PrintfMethod · 0.45
ErrorfMethod · 0.45

Tested by 1