From a31b534b36eda669bab99819e4b45fa343ff38d9 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Fri, 19 May 2023 22:31:56 +0700 Subject: all: load private key only when needed In case the configuration use private key with passphrase, the bash completion will hang due to the command ask for passphrase. This changes fix this issue by loading private key only when doing add, generate, import, or remote-private-key. --- cli_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli_test.go') diff --git a/cli_test.go b/cli_test.go index 70a5e1d..81253b1 100644 --- a/cli_test.go +++ b/cli_test.go @@ -191,6 +191,11 @@ func TestCli_SetPrivateKey(t *testing.T) { } cli.cfg = cfg + cli.cfg.privateKey, err = loadPrivateKey(cli.cfg.PrivateKey, nil) + if err != nil { + t.Fatal(err) + } + var ( gotLabels []string = cli.List() label string -- cgit v1.3