mirror of https://github.com/schollz/croc.git
Merge pull request #198 from rkuprov/shared-secret-update
croc: secret phrase parsing
This commit is contained in:
commit
d4cbe03d0d
|
@ -304,8 +304,15 @@ func receive(c *cli.Context) (err error) {
|
||||||
Ask: c.GlobalBool("ask"),
|
Ask: c.GlobalBool("ask"),
|
||||||
RelayPassword: c.GlobalString("pass"),
|
RelayPassword: c.GlobalString("pass"),
|
||||||
}
|
}
|
||||||
if c.Args().First() != "" {
|
|
||||||
|
switch len(c.Args()) {
|
||||||
|
case 1:
|
||||||
crocOptions.SharedSecret = c.Args().First()
|
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
|
// load options here
|
||||||
|
|
Loading…
Reference in New Issue