summaryrefslogtreecommitdiff
path: root/complete.go
diff options
context:
space:
mode:
Diffstat (limited to 'complete.go')
-rw-r--r--complete.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/complete.go b/complete.go
index 2a4c905..0641c39 100644
--- a/complete.go
+++ b/complete.go
@@ -49,10 +49,8 @@ func (p PredictFunc) Predict(prefix string) []string {
}
var (
- getEnv = os.Getenv
- exit = os.Exit
- out io.Writer = os.Stdout
- in io.Reader = os.Stdin
+ getEnv = os.Getenv
+ exit = os.Exit
)
// Complete the command line arguments for the given command in the case that the program
@@ -66,6 +64,10 @@ func Complete(name string, cmd Completer) {
doUninstall = getEnv("COMP_UNINSTALL") == "1"
yes = getEnv("COMP_YES") == "1"
)
+ var (
+ out io.Writer = os.Stdout
+ in io.Reader = os.Stdin
+ )
if doInstall || doUninstall {
install.Run(name, doUninstall, yes, out, in)
exit(0)