From dbb5ddf2b6f67c2bd7ff2af8f92a943262d5f09a Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sun, 22 Oct 2017 11:26:53 -0600 Subject: [PATCH] Minor improvements to UI --- connect.go | 10 ++++++++-- main.go | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/connect.go b/connect.go index cd53a64..7b64d89 100644 --- a/connect.go +++ b/connect.go @@ -317,10 +317,16 @@ func (c *Connection) runClient() error { log.Debugf("meta data received: %v", c.File) // have the main thread ask for the okay if id == 0 { + fType := "file" + fName := path.Join(c.Path, c.File.Name) + if c.File.IsDir { + fType = "folder" + fName = fName[:len(fName)-4] + } if _, err := os.Stat(path.Join(c.Path, c.File.Name)); os.IsNotExist(err) { - fmt.Printf("Receiving file (%s) into: %s\n", humanize.Bytes(uint64(c.File.Size)), path.Join(c.Path, c.File.Name)) + fmt.Printf("Receiving %s (%s) into: %s\n", fType, humanize.Bytes(uint64(c.File.Size)), fName) } else { - fmt.Printf("Overwriting file %s (%s)\n", path.Join(c.Path, c.File.Name), humanize.Bytes(uint64(c.File.Size))) + fmt.Printf("Overwriting %s %s (%s)\n", fType, fName, humanize.Bytes(uint64(c.File.Size))) } var sentFileNames []string diff --git a/main.go b/main.go index f406603..c899bf1 100644 --- a/main.go +++ b/main.go @@ -38,8 +38,7 @@ func main() { /^^\________/0 \ || ( ` + "`" + `~+++,,_||__,,++~^^^^^^^ ...V^V^V^V^V^V^\............................... - - + `) flags := new(Flags) flag.BoolVar(&flags.Relay, "relay", false, "run as relay")