diff --git a/README.md b/README.md index 6d96a380..33bf038e 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,11 @@ _These two gifs should run in sync if you force-reload (Ctl+F5)_ **Sender:** -![send](https://user-images.githubusercontent.com/6550035/32415611-9bfa858a-c1f9-11e7-9573-52c1edc52e5f.gif) +![send](https://raw.githubusercontent.com/schollz/croc/master/logo/sender.gif) **Receiver:** -![receive](https://user-images.githubusercontent.com/6550035/32415609-9ba49dc8-c1f9-11e7-9c86-ea0baae730fe.gif) +![receive](https://raw.githubusercontent.com/schollz/croc/master/logo/receiver.gif) **Sender:** diff --git a/connect.go b/connect.go index 4b1e34a4..a21b658f 100644 --- a/connect.go +++ b/connect.go @@ -108,7 +108,7 @@ func NewConnection(config *AppConfig) (*Connection, error) { } if info.Mode().IsDir() { // if our file is a dir - fmt.Println("compressing directory...") + fmt.Println("Compressing folder...") // we "tarify" the file err = tarinator.Tarinate([]string{config.File}, path.Base(config.File)+".tar") @@ -208,7 +208,11 @@ func (c *Connection) Run() error { log.Debug("checking code validity") if len(c.Code) == 0 { - c.Code = GetRandomName() + if c.IsSender { + c.Code = GetRandomName() + } else { + c.Code = getInput("Enter receive code: ") + } log.Debug("changed code to ", c.Code) } @@ -507,10 +511,14 @@ func (c *Connection) runClient() error { fmt.Println("Timeout waiting for receiver") return nil } - fmt.Print("\nFile sent") + fileOrFolder := "File" + if c.File.IsDir { + fileOrFolder = "Folder" + } + fmt.Printf("\n%s sent", fileOrFolder) } else { // Is a Receiver if responses.notPresent { - fmt.Println("Sender is not ready. Use -wait to wait until sender connects.") + fmt.Println("Either code is incorrect or sender is not ready. Use -wait to wait until sender connects.") return nil } if !responses.gotOK { @@ -550,7 +558,7 @@ func (c *Connection) runClient() error { return fmt.Errorf("\nUh oh! %s is corrupted! Sorry, try again.\n", c.File.Name) } if c.File.IsDir { // if the file was originally a dir - fmt.Print("\ndecompressing folder") + fmt.Print("\nDecompressing folder...") log.Debug("untarring " + c.File.Name) err := tarinator.UnTarinate(c.Path, path.Join(c.Path, c.File.Name)) if err != nil { diff --git a/help.go b/help.go index 5937b3f3..ec37fc7a 100644 --- a/help.go +++ b/help.go @@ -1,6 +1,17 @@ package main -var helpTemplate = `NAME: +var helpTemplate = ` + ,_ + >' ) + ( ( \ + || \ + /^^^^\ || + /^^\________/0 \ || + ( ` + "`" + `~+++,,_||__,,++~^^^^^^^ + ...V^V^V^V^V^V^\............................... + + +NAME: {{.Name}} - {{.Usage}} USAGE: diff --git a/logo/receiver.gif b/logo/receiver.gif new file mode 100644 index 00000000..4d2741ee Binary files /dev/null and b/logo/receiver.gif differ diff --git a/logo/sender.gif b/logo/sender.gif new file mode 100644 index 00000000..5f58080c Binary files /dev/null and b/logo/sender.gif differ diff --git a/main.go b/main.go index 1eb92973..2a913a5d 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,6 @@ import ( const BUFFERSIZE = 1024 type AppConfig struct { - HideLogo bool `yaml:"hidelogo" flagName:"hidelogo" flagSName:"hl" flagDescribe:"Hidden logo" default:"false"` Relay bool `yaml:"relay" flagName:"relay" flagSName:"r" flagDescribe:"Run as relay" default:"false"` Debug bool `yaml:"debug" flagName:"debug" flagSName:"d" flagDescribe:"Debug mode" default:"false"` Wait bool `yaml:"wait" flagName:"wait" flagSName:"w" flagDescribe:"Wait for code to be sent" default:"false"` @@ -77,22 +76,6 @@ func main() { } ApplyFlags(cliFlags, flagMappings, c, appOptions) - if appOptions.UseStdout { - appOptions.HideLogo = true - } - if !appOptions.HideLogo { - fmt.Println(` - ,_ - >' ) - croc version ` + fmt.Sprintf("%5s", version) + ` ( ( \ - || \ - /^^^^\ || - /^^\________/0 \ || - ( ` + "`" + `~+++,,_||__,,++~^^^^^^^ - ...V^V^V^V^V^V^\............................... - - `) - } if appOptions.Relay { fmt.Println("running relay on local address " + GetLocalIP())