1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

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

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