mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
don't show description if only sending one file
This commit is contained in:
parent
6e9156d49c
commit
fb2723d80b
1 changed files with 8 additions and 3 deletions
|
@ -1189,7 +1189,8 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error)
|
||||||
// setup the progressbar
|
// setup the progressbar
|
||||||
description := fmt.Sprintf("%-*s", c.longestFilename, c.FilesToTransfer[i].Name)
|
description := fmt.Sprintf("%-*s", c.longestFilename, c.FilesToTransfer[i].Name)
|
||||||
if len(c.FilesToTransfer) == 1 {
|
if len(c.FilesToTransfer) == 1 {
|
||||||
description = c.FilesToTransfer[i].Name
|
// description = c.FilesToTransfer[i].Name
|
||||||
|
description = ""
|
||||||
}
|
}
|
||||||
c.bar = progressbar.NewOptions64(1,
|
c.bar = progressbar.NewOptions64(1,
|
||||||
progressbar.OptionOnCompletion(func() {
|
progressbar.OptionOnCompletion(func() {
|
||||||
|
@ -1256,6 +1257,8 @@ func (c *Client) fmtPrintUpdate() {
|
||||||
c.finishedNum++
|
c.finishedNum++
|
||||||
if len(c.FilesToTransfer) > 1 {
|
if len(c.FilesToTransfer) > 1 {
|
||||||
fmt.Fprintf(os.Stderr, " %d/%d\n", c.finishedNum, len(c.FilesToTransfer))
|
fmt.Fprintf(os.Stderr, " %d/%d\n", c.finishedNum, len(c.FilesToTransfer))
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(os.Stderr, "\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1282,7 +1285,8 @@ func (c *Client) updateState() (err error) {
|
||||||
// setup the progressbar and takedown the progress bar for empty files
|
// setup the progressbar and takedown the progress bar for empty files
|
||||||
description := fmt.Sprintf("%-*s", c.longestFilename, c.FilesToTransfer[i].Name)
|
description := fmt.Sprintf("%-*s", c.longestFilename, c.FilesToTransfer[i].Name)
|
||||||
if len(c.FilesToTransfer) == 1 {
|
if len(c.FilesToTransfer) == 1 {
|
||||||
description = c.FilesToTransfer[i].Name
|
// description = c.FilesToTransfer[i].Name
|
||||||
|
description = ""
|
||||||
}
|
}
|
||||||
c.bar = progressbar.NewOptions64(1,
|
c.bar = progressbar.NewOptions64(1,
|
||||||
progressbar.OptionOnCompletion(func() {
|
progressbar.OptionOnCompletion(func() {
|
||||||
|
@ -1326,7 +1330,8 @@ func (c *Client) updateState() (err error) {
|
||||||
func (c *Client) setBar() {
|
func (c *Client) setBar() {
|
||||||
description := fmt.Sprintf("%-*s", c.longestFilename, c.FilesToTransfer[c.FilesToTransferCurrentNum].Name)
|
description := fmt.Sprintf("%-*s", c.longestFilename, c.FilesToTransfer[c.FilesToTransferCurrentNum].Name)
|
||||||
if len(c.FilesToTransfer) == 1 {
|
if len(c.FilesToTransfer) == 1 {
|
||||||
description = c.FilesToTransfer[c.FilesToTransferCurrentNum].Name
|
// description = c.FilesToTransfer[c.FilesToTransferCurrentNum].Name
|
||||||
|
description = ""
|
||||||
}
|
}
|
||||||
c.bar = progressbar.NewOptions64(
|
c.bar = progressbar.NewOptions64(
|
||||||
c.FilesToTransfer[c.FilesToTransferCurrentNum].Size,
|
c.FilesToTransfer[c.FilesToTransferCurrentNum].Size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue