Handle people specifying PGP key files with @ in front
This commit is contained in:
parent
2f3e245b0b
commit
a7316f2e24
|
@ -27,6 +27,9 @@ func (g *pgpkeys) Set(value string) error {
|
||||||
return errors.New("pgp-keys can only be specified once")
|
return errors.New("pgp-keys can only be specified once")
|
||||||
}
|
}
|
||||||
for _, keyfile := range strings.Split(value, ",") {
|
for _, keyfile := range strings.Split(value, ",") {
|
||||||
|
if keyfile[0] == '@' {
|
||||||
|
keyfile = keyfile[1:]
|
||||||
|
}
|
||||||
f, err := os.Open(keyfile)
|
f, err := os.Open(keyfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -169,7 +169,7 @@ func TestInit_PGP(t *testing.T) {
|
||||||
args := []string{
|
args := []string{
|
||||||
"-address", addr,
|
"-address", addr,
|
||||||
"-key-shares", "2",
|
"-key-shares", "2",
|
||||||
"-pgp-keys", tempDir + "/pubkey1," + tempDir + "/pubkey2," + tempDir + "/pubkey3",
|
"-pgp-keys", tempDir + "/pubkey1,@" + tempDir + "/pubkey2," + tempDir + "/pubkey3",
|
||||||
"-key-threshold", "2",
|
"-key-threshold", "2",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue