From d555a81d30f927b551c5d69fecaca2a2d46233fc Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 21 Sep 2018 22:18:41 -0700 Subject: [PATCH] generate code phrase if not prompted --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 811f45d..183934f 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "time" "github.com/schollz/croc/src/croc" + "github.com/schollz/utils" "github.com/urfave/cli" ) @@ -107,6 +108,10 @@ func send(c *cli.Context) error { if c.String("code") != "" { codePhrase = c.String("code") } + if len(codePhrase) == 0 { + // generate code phrase + codePhrase = utils.GetRandomName() + } return cr.Send(fname, codePhrase) }