mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 00:40:03 +01:00
fs: Add --stats-file-name-length to specify the printed file name length for stats
Fixes #1206
This commit is contained in:
parent
57f1bb7bb2
commit
5c7e8d5a2b
@ -572,9 +572,11 @@ func (acc *Account) String() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
name := []rune(acc.name)
|
name := []rune(acc.name)
|
||||||
if len(name) > 40 {
|
if Config.StatsFileNameLength > 0 {
|
||||||
where := len(name) - 37
|
if len(name) > Config.StatsFileNameLength {
|
||||||
name = append([]rune{'.', '.', '.'}, name[where:]...)
|
where := len(name) - Config.StatsFileNameLength
|
||||||
|
name = append([]rune{'.', '.', '.'}, name[where:]...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if Config.DataRateUnit == "bits" {
|
if Config.DataRateUnit == "bits" {
|
||||||
|
@ -114,6 +114,7 @@ var (
|
|||||||
userAgent = StringP("user-agent", "", "rclone/"+Version, "Set the user-agent to a specified string. The default is rclone/ version")
|
userAgent = StringP("user-agent", "", "rclone/"+Version, "Set the user-agent to a specified string. The default is rclone/ version")
|
||||||
immutable = BoolP("immutable", "", false, "Do not modify files. Fail if existing files have been modified.")
|
immutable = BoolP("immutable", "", false, "Do not modify files. Fail if existing files have been modified.")
|
||||||
autoConfirm = BoolP("auto-confirm", "", false, "If enabled, do not request console confirmation.")
|
autoConfirm = BoolP("auto-confirm", "", false, "If enabled, do not request console confirmation.")
|
||||||
|
statsFileNameLength = IntP("stats-file-name-length", "", 40, "Max file name length in stats. 0 for no limit")
|
||||||
streamingUploadCutoff = SizeSuffix(100 * 1024)
|
streamingUploadCutoff = SizeSuffix(100 * 1024)
|
||||||
dump DumpFlags
|
dump DumpFlags
|
||||||
logLevel = LogLevelNotice
|
logLevel = LogLevelNotice
|
||||||
@ -255,6 +256,7 @@ type ConfigInfo struct {
|
|||||||
Immutable bool
|
Immutable bool
|
||||||
AutoConfirm bool
|
AutoConfirm bool
|
||||||
StreamingUploadCutoff SizeSuffix
|
StreamingUploadCutoff SizeSuffix
|
||||||
|
StatsFileNameLength int
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the path to the configuration file
|
// Return the path to the configuration file
|
||||||
@ -392,6 +394,7 @@ func LoadConfig() {
|
|||||||
Config.TPSLimitBurst = *tpsLimitBurst
|
Config.TPSLimitBurst = *tpsLimitBurst
|
||||||
Config.Immutable = *immutable
|
Config.Immutable = *immutable
|
||||||
Config.AutoConfirm = *autoConfirm
|
Config.AutoConfirm = *autoConfirm
|
||||||
|
Config.StatsFileNameLength = *statsFileNameLength
|
||||||
Config.BufferSize = bufferSize
|
Config.BufferSize = bufferSize
|
||||||
Config.StreamingUploadCutoff = streamingUploadCutoff
|
Config.StreamingUploadCutoff = streamingUploadCutoff
|
||||||
Config.Dump = dump
|
Config.Dump = dump
|
||||||
|
Loading…
Reference in New Issue
Block a user