Merge pull request #198 from rkuprov/shared-secret-update

croc: secret phrase parsing
This commit is contained in:
Zack 2020-02-18 10:51:29 -08:00 committed by GitHub
commit d4cbe03d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -304,8 +304,15 @@ func receive(c *cli.Context) (err error) {
Ask: c.GlobalBool("ask"),
RelayPassword: c.GlobalString("pass"),
}
if c.Args().First() != "" {
switch len(c.Args()) {
case 1:
crocOptions.SharedSecret = c.Args().First()
case 3:
var phrase []string
phrase = append(phrase, c.Args().First())
phrase = append(phrase, c.Args().Tail()...)
crocOptions.SharedSecret = strings.Join(phrase, "-")
}
// load options here