Tweaked 'pv' progress bar output format options

Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
Russ Magee 2020-04-03 20:08:45 -07:00
parent 4686361ece
commit 09c2408c06
3 changed files with 5 additions and 2 deletions

1
go.mod
View File

@ -6,6 +6,7 @@ require (
blitter.com/go/cryptmt v1.0.2 blitter.com/go/cryptmt v1.0.2
blitter.com/go/goutmp v1.0.2 blitter.com/go/goutmp v1.0.2
blitter.com/go/herradurakex v1.0.0 blitter.com/go/herradurakex v1.0.0
blitter.com/go/hopscotch v0.0.0-20200320040654-43cb7c7c7e95 // indirect
blitter.com/go/kyber v0.0.0-20200130200857-6f2021cb88d9 blitter.com/go/kyber v0.0.0-20200130200857-6f2021cb88d9
blitter.com/go/mtwist v1.0.1 // indirect blitter.com/go/mtwist v1.0.1 // indirect
blitter.com/go/newhope v0.0.0-20200130200750-192fc08a8aae blitter.com/go/newhope v0.0.0-20200130200750-192fc08a8aae

2
go.sum
View File

@ -12,6 +12,8 @@ blitter.com/go/goutmp v1.0.2 h1:oCc/dt9TlTOP2kvmX1Y7J/wSQUhywjcyF101jXuLxZ8=
blitter.com/go/goutmp v1.0.2/go.mod h1:gtlbjC8xGzMk/Cf0BpnVltSa3awOqJ+B5WAxVptTMxk= blitter.com/go/goutmp v1.0.2/go.mod h1:gtlbjC8xGzMk/Cf0BpnVltSa3awOqJ+B5WAxVptTMxk=
blitter.com/go/herradurakex v1.0.0 h1:6XaxY+JLT1HUWPF0gYJnjX3pVjrw4YhYZEzZ1U0wkyc= blitter.com/go/herradurakex v1.0.0 h1:6XaxY+JLT1HUWPF0gYJnjX3pVjrw4YhYZEzZ1U0wkyc=
blitter.com/go/herradurakex v1.0.0/go.mod h1:m3+vYZX+2dDjdo+n/HDnXEYJX9pwmNeQLgAfJM8mtxw= blitter.com/go/herradurakex v1.0.0/go.mod h1:m3+vYZX+2dDjdo+n/HDnXEYJX9pwmNeQLgAfJM8mtxw=
blitter.com/go/hopscotch v0.0.0-20200320040654-43cb7c7c7e95 h1:X6rWBxK+ZqALnpxsk0Rt0VHx5GVLK3Ldz46f+3RCXe8=
blitter.com/go/hopscotch v0.0.0-20200320040654-43cb7c7c7e95/go.mod h1:9Da1oy0t9aUw3wviba+2mP1inbLGbDuCKAO3mmGQha4=
blitter.com/go/kyber v0.0.0-20200130200857-6f2021cb88d9 h1:D45AnrNphtvczBXRp5JQicZRTgaK/Is5bgPDDvRKhTc= blitter.com/go/kyber v0.0.0-20200130200857-6f2021cb88d9 h1:D45AnrNphtvczBXRp5JQicZRTgaK/Is5bgPDDvRKhTc=
blitter.com/go/kyber v0.0.0-20200130200857-6f2021cb88d9/go.mod h1:SK6QfGG72lIfKW1Td0wH7f0wwN5nSIhV3K+wvzGNjrw= blitter.com/go/kyber v0.0.0-20200130200857-6f2021cb88d9/go.mod h1:SK6QfGG72lIfKW1Td0wH7f0wwN5nSIhV3K+wvzGNjrw=
blitter.com/go/mtwist v1.0.1 h1:PxmoWexfMpLmc8neHP/PcRc3s17ct7iz4d5W/qJVt04= blitter.com/go/mtwist v1.0.1 h1:PxmoWexfMpLmc8neHP/PcRc3s17ct7iz4d5W/qJVt04=

View File

@ -258,7 +258,7 @@ func buildCmdRemoteToLocal(copyQuiet bool, copyLimitBPS uint, destPath, files st
} else { } else {
// TODO: Query remote side for total file/dir size // TODO: Query remote side for total file/dir size
bandwidthInBytesPerSec := " -L " + fmt.Sprintf("%d ", copyLimitBPS) bandwidthInBytesPerSec := " -L " + fmt.Sprintf("%d ", copyLimitBPS)
displayOpts := " -f -pr " displayOpts := " -pre "
cmd = "/bin/bash" cmd = "/bin/bash"
args = []string{"-c", "pv " + displayOpts + bandwidthInBytesPerSec + "| tar -xz -C " + destPath} args = []string{"-c", "pv " + displayOpts + bandwidthInBytesPerSec + "| tar -xz -C " + destPath}
} }
@ -306,7 +306,7 @@ func buildCmdLocalToRemote(copyQuiet bool, copyLimitBPS uint, files string) (cap
} else { } else {
captureStderr = copyQuiet captureStderr = copyQuiet
bandwidthInBytesPerSec := " -L " + fmt.Sprintf("%d", copyLimitBPS) bandwidthInBytesPerSec := " -L " + fmt.Sprintf("%d", copyLimitBPS)
displayOpts := " -f -pr " displayOpts := " -pre "
cmd = "/bin/bash" cmd = "/bin/bash"
args = []string{"-c", "/bin/tar -cz -f /dev/stdout "} args = []string{"-c", "/bin/tar -cz -f /dev/stdout "}
files = strings.TrimSpace(files) files = strings.TrimSpace(files)