-progress cli param for bars

This commit is contained in:
Sebastian Frank
2019-03-25 14:01:28 +01:00
parent 740fb94556
commit 267d1010bb
12 changed files with 166 additions and 38 deletions

13
pkg/helper/string.go Normal file
View File

@@ -0,0 +1,13 @@
package helper
// ShortenStringLeft shortens a string
func ShortenStringLeft(str string, num int) string {
tstr := str
if len(str) > num {
if num > 3 {
num -= 3
}
tstr = "..." + str[len(str)-num:len(str)]
}
return tstr
}