mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs: Add --disable flag to disable optional features - fixes #1551
Eg to disable server side copy use `--disable copy`, to see a list of what you can disable, `--disable help`.
This commit is contained in:
@@ -100,6 +100,7 @@ var (
|
||||
tpsLimit = Float64P("tpslimit", "", 0, "Limit HTTP transactions per second to this.")
|
||||
tpsLimitBurst = IntP("tpslimit-burst", "", 1, "Max burst of transactions for --tpslimit.")
|
||||
bindAddr = StringP("bind", "", "", "Local address to bind to for outgoing connections, IPv4, IPv6 or name.")
|
||||
disableFeatures = StringP("disable", "", "", "Disable a comma separated list of features. Use help to see a list.")
|
||||
logLevel = LogLevelNotice
|
||||
statsLogLevel = LogLevelInfo
|
||||
bwLimit BwTimetable
|
||||
@@ -235,6 +236,7 @@ type ConfigInfo struct {
|
||||
TPSLimit float64
|
||||
TPSLimitBurst int
|
||||
BindAddr net.IP
|
||||
DisableFeatures []string
|
||||
}
|
||||
|
||||
// Return the path to the configuration file
|
||||
@@ -410,6 +412,13 @@ func LoadConfig() {
|
||||
Config.BindAddr = addrs[0]
|
||||
}
|
||||
|
||||
if *disableFeatures != "" {
|
||||
if *disableFeatures == "help" {
|
||||
log.Fatalf("Possible backend features are: %s\n", strings.Join(new(Features).List(), ", "))
|
||||
}
|
||||
Config.DisableFeatures = strings.Split(*disableFeatures, ",")
|
||||
}
|
||||
|
||||
// Load configuration file.
|
||||
var err error
|
||||
ConfigPath, err = filepath.Abs(*configFile)
|
||||
|
||||
Reference in New Issue
Block a user