From b7e4a73c2779ab19c0a8d8e394d2b087a122ee92 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 18 May 2022 16:57:00 -0700 Subject: [PATCH] don't show number of folders if the number is 0 --- src/croc/croc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 54500346..00287539 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -980,7 +980,11 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error machID, _ := machineid.ID() fmt.Fprintf(os.Stderr, "\rYour machine id is '%s'.\n%s %s (%s) from '%s'? (Y/n) ", machID, action, fname, utils.ByteCountDecimal(totalSize), senderInfo.MachineID) } else { - fmt.Fprintf(os.Stderr, "\r%s %s and %s (%s)? (Y/n) ", action, fname, folderName, utils.ByteCountDecimal(totalSize)) + if c.TotalNumberFolders > 0 { + fmt.Fprintf(os.Stderr, "\r%s %s and %s (%s)? (Y/n) ", action, fname, folderName, utils.ByteCountDecimal(totalSize)) + } else { + fmt.Fprintf(os.Stderr, "\r%s %s (%s)? (Y/n) ", action, fname, utils.ByteCountDecimal(totalSize)) + } } choice := strings.ToLower(utils.GetInput("")) if choice != "" && choice != "y" && choice != "yes" {