mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
@@ -6,6 +6,7 @@ package configflags
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -23,6 +24,7 @@ var (
|
||||
verbose int
|
||||
quiet bool
|
||||
configPath string
|
||||
tempDir string
|
||||
dumpHeaders bool
|
||||
dumpBodies bool
|
||||
deleteBefore bool
|
||||
@@ -47,6 +49,7 @@ func AddFlags(ci *fs.ConfigInfo, flagSet *pflag.FlagSet) {
|
||||
flags.IntVarP(flagSet, &ci.Transfers, "transfers", "", ci.Transfers, "Number of file transfers to run in parallel.")
|
||||
flags.StringVarP(flagSet, &configPath, "config", "", config.GetConfigPath(), "Config file.")
|
||||
flags.StringVarP(flagSet, &config.CacheDir, "cache-dir", "", config.CacheDir, "Directory rclone will use for caching.")
|
||||
flags.StringVarP(flagSet, &tempDir, "temp-dir", "", os.TempDir(), "Directory rclone will use for temporary files.")
|
||||
flags.BoolVarP(flagSet, &ci.CheckSum, "checksum", "c", ci.CheckSum, "Skip based on checksum (if available) & size, not mod-time & size")
|
||||
flags.BoolVarP(flagSet, &ci.SizeOnly, "size-only", "", ci.SizeOnly, "Skip based on size only, not mod-time or checksum")
|
||||
flags.BoolVarP(flagSet, &ci.IgnoreTimes, "ignore-times", "I", ci.IgnoreTimes, "Don't skip files that match size and time - transfer all files")
|
||||
@@ -278,6 +281,11 @@ func SetFlags(ci *fs.ConfigInfo) {
|
||||
log.Fatalf("--config: Failed to set %q as config path: %v", configPath, err)
|
||||
}
|
||||
|
||||
// Set path to temp dir
|
||||
if err := config.SetTempDir(tempDir); err != nil {
|
||||
log.Fatalf("--temp-dir: Failed to set %q as temp dir: %v", tempDir, err)
|
||||
}
|
||||
|
||||
// Set whether multi-thread-streams was set
|
||||
multiThreadStreamsFlag := pflag.Lookup("multi-thread-streams")
|
||||
ci.MultiThreadSet = multiThreadStreamsFlag != nil && multiThreadStreamsFlag.Changed
|
||||
|
||||
Reference in New Issue
Block a user