mirror of
https://github.com/restic/restic.git
synced 2025-10-09 23:23:34 +00:00
rclone: Rework backend option parsing
This change allows passing no arguments to rclone, using `-o rclone.args=""`. It is helpful when running rclone remotely via SSH using a key with a forced command (via `command=` in `authorized_keys`).
This commit is contained in:
@@ -15,15 +15,19 @@ type Config struct {
|
||||
Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"`
|
||||
}
|
||||
|
||||
var defaultConfig = Config{
|
||||
Program: "rclone",
|
||||
Args: "serve restic --stdio --b2-hard-delete --drive-use-trash=false",
|
||||
Connections: 5,
|
||||
}
|
||||
|
||||
func init() {
|
||||
options.Register("rclone", Config{})
|
||||
}
|
||||
|
||||
// NewConfig returns a new Config with the default values filled in.
|
||||
func NewConfig() Config {
|
||||
return Config{
|
||||
Connections: 5,
|
||||
}
|
||||
return defaultConfig
|
||||
}
|
||||
|
||||
// ParseConfig parses the string s and extracts the remote server URL.
|
||||
|
Reference in New Issue
Block a user