From cd09ef46146d047fba16854fe86b65b9fd43b626 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 19 Oct 2023 22:35:24 +0200 Subject: [PATCH] don't load password when autocompleting CLI commands --- changelog/unreleased/issue-4516 | 8 ++++++++ cmd/restic/main.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/issue-4516 diff --git a/changelog/unreleased/issue-4516 b/changelog/unreleased/issue-4516 new file mode 100644 index 000000000..de7833e33 --- /dev/null +++ b/changelog/unreleased/issue-4516 @@ -0,0 +1,8 @@ +Bugfix: Do not try to load password on command line autocomplete + +The command line autocompletion previously tried to load the repository +password. This could cause the autocompletion not to work. Now, this step gets +skipped. + +https://github.com/restic/restic/issues/4516 +https://github.com/restic/restic/pull/4526 diff --git a/cmd/restic/main.go b/cmd/restic/main.go index 2159fb14f..4595e8161 100644 --- a/cmd/restic/main.go +++ b/cmd/restic/main.go @@ -80,7 +80,7 @@ The full documentation can be found at https://restic.readthedocs.io/ . // user for authentication). func needsPassword(cmd string) bool { switch cmd { - case "cache", "generate", "help", "options", "self-update", "version": + case "cache", "generate", "help", "options", "self-update", "version", "__complete": return false default: return true