OK here is my proposal.
I invent some way of tagging global flags (not backend flags) to be part of a small number of groups. This tagging will be in the source code and you will need to supply it when defining a flag so we won't forget it.
Something like this to put the flag into the Sync
group. You won't be able to make up groups there, they will be predefined.
flags.Int64VarP(flagSet, &ci.MaxDelete, "max-delete", "", -1, "When synchronizing, limit the number of deletes", "Sync")
We then decide which of these groups we want to show in in each rclone command by adding a bit of metadata, something like:
Annotations: map[string]string{
"versionIntroduced": "v1.52",
"flagsGroups": "Copy,Sync,List",
},
(you can see there the metadata which makes the first version available tags in the docs)
We can also break up the flags page into these groups to make it more digestible.
Open questions - do flags need to be part of more than one group?
Here is my initial classification - comments welcome!
Groups of flags
Copy
Flags used for sync
, copy
, move
, copyto
, moveto
, rcat
. Basically anything which can copy a file using operations.Copy
.
--backup-dir string Make backups into hierarchy based in DIR
--check-first Do all the checks before starting transfers
-c, --checksum Skip based on checksum (if available) & size, not mod-time & size
--compare-dest stringArray Include additional comma separated server-side paths during comparison
--copy-dest stringArray Implies --compare-dest but also copies files from paths into destination
--cutoff-mode string Mode to stop transfers when reaching the max transfer limit HARD|SOFT|CAUTIOUS (default "HARD")
--ignore-case-sync Ignore case when synchronizing
--ignore-checksum Skip post copy check of checksums
--ignore-existing Skip all files that exist on destination
--ignore-size Ignore size when skipping use mod-time or checksum
-I, --ignore-times Don't skip files that match size and time - transfer all files
--immutable Do not modify files, fail if existing files have been modified
--inplace Download directly to destination file instead of atomic download to temp/rename
--max-backlog int Maximum number of objects in sync or check backlog (default 10000)
--max-delete int When synchronizing, limit the number of deletes (default -1)
--max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off)
--max-duration Duration Maximum duration rclone will transfer data for (default 0s)
-M, --metadata If set, preserve metadata when copying objects
--modify-window Duration Max time diff to be considered the same (default 1ns)
--multi-thread-cutoff SizeSuffix Use multi-thread downloads for files above this size (default 250Mi)
--multi-thread-streams int Max number of streams to use for multi-thread downloads (default 4)
--multi-thread-write-buffer-size SizeSuffix In memory buffer size for writing when in multi-thread mode (default 128Ki)
--no-check-dest Don't check the destination, copy regardless
--no-traverse Don't traverse destination file system on copy
--no-unicode-normalization Don't normalize unicode characters in filenames
--no-update-modtime Don't update destination mod-time if files identical
--order-by string Instructions on how to order the transfers, e.g. 'size,descending'
--refresh-times Refresh the modtime of remote files
--server-side-across-configs Allow server-side operations (e.g. copy) to work across different configs
--size-only Skip based on size only, not mod-time or checksum
--streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
--suffix string Suffix to add to changed files
--suffix-keep-extension Preserve the extension when using --suffix
-u, --update Skip files that are newer on the destination
Sync only
Flags just used for rclone sync
--delete-after When synchronizing, delete files on destination after transferring (default)
--delete-before When synchronizing, delete files on destination before transferring
--delete-during When synchronizing, delete files during transfer
--delete-excluded Delete files on dest excluded from sync
--ignore-errors Delete even if there are I/O errors
--track-renames When synchronizing, track file renames and do a server-side move if possible
--track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash")
Networking
General networking and HTTP stuff
--bind string Local address to bind to for outgoing connections, IPv4, IPv6 or name
--bwlimit BwTimetable Bandwidth limit in KiB/s, or use suffix B|K|M|G|T|P or a full timetable
--bwlimit-file BwTimetable Bandwidth limit per file in KiB/s, or use suffix B|K|M|G|T|P or a full timetable
--ca-cert stringArray CA certificate used to verify servers
--client-cert string Client SSL certificate (PEM) for mutual TLS auth
--client-key string Client SSL private key (PEM) for mutual TLS auth
--contimeout Duration Connect timeout (default 1m0s)
--disable-http-keep-alives Disable HTTP keep-alives and use each connection once.
--disable-http2 Disable HTTP/2 in the global transport
--dscp string Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21
--expect-continue-timeout Duration Timeout when using expect / 100-continue in HTTP (default 1s)
--header stringArray Set HTTP header for all transactions
--header-download stringArray Set HTTP header for download transactions
--header-upload stringArray Set HTTP header for upload transactions
--no-check-certificate Do not verify the server SSL certificate (insecure)
--no-gzip-encoding Don't set Accept-Encoding: gzip
--timeout Duration IO idle timeout (default 5m0s)
--tpslimit float Limit HTTP transactions per second to this
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
--use-cookies Enable session cookiejar
--user-agent string Set the user-agent to a specified string (default "rclone/v1.64.0-beta.7130.3f588d9bb.fix-smb-about")
Performance
Could mark some of the flags as important for performance
--buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi)
--checkers int Number of checkers to run in parallel (default 8)
Config
General config that didn't go elsewhere.
Some of these are more important, eg --dry-run
, --checkers
, --transfers
so maybe there should be an important config section.
--ask-password Allow prompt for password for encrypted configuration (default true)
--auto-confirm If enabled, do not request console confirmation
--cache-dir string Directory rclone will use for caching (default "/home/ncw/.cache/rclone")
--color string When to show colors (and other ANSI codes) AUTO|NEVER|ALWAYS (default "AUTO")
--config string Config file (default "/home/ncw/.rclone.conf")
--default-time Time Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
--disable string Disable a comma separated list of features (use --disable help to see a list)
-n, --dry-run Do a trial run with no permanent changes
--error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts
--fs-cache-expire-duration Duration Cache remotes for this long (0 to disable caching) (default 5m0s)
--fs-cache-expire-interval Duration Interval to check for expired remotes (default 1m0s)
--human-readable Print numbers in a human-readable format, sizes with suffix Ki|Mi|Gi|Ti|Pi
-i, --interactive Enable interactive mode
--kv-lock-time Duration Maximum time to keep key-value database locked by process (default 1s)
--low-level-retries int Number of low level retries to do (default 10)
--no-console Hide console window (supported on Windows only)
--password-command SpaceSepList Command for supplying password for encrypted configuration
--retries int Retry operations this many times if they fail (default 3)
--retries-sleep Duration Interval between retrying operations if they fail, e.g. 500ms, 60s, 5m (0 to disable) (default 0s)
--temp-dir string Directory rclone will use for temporary files (default "/tmp")
--transfers int Number of file transfers to run in parallel (default 4)
--use-mmap Use mmap allocator (see docs)
--use-server-modtime Use server modified time instead of object metadata
Debugging
--dump DumpFlags List of items to dump from: headers,bodies,requests,responses,auth,filters,goroutines,openfiles
--memprofile string Write memory profile to file
--cpuprofile string Write cpu profile to file
Filter
Filters apply to most rclone commands except rclone purge
.
--exclude stringArray Exclude files matching pattern
--exclude-from stringArray Read file exclude patterns from file (use - to read from stdin)
--exclude-if-present stringArray Exclude directories if filename is present
--files-from stringArray Read list of source-file names from file (use - to read from stdin)
--files-from-raw stringArray Read list of source-file names from file without any processing of lines (use - to read from stdin)
-f, --filter stringArray Add a file filtering rule
--filter-from stringArray Read file filtering patterns from a file (use - to read from stdin)
--ignore-case Ignore case in filters (case insensitive)
--include stringArray Include files matching pattern
--include-from stringArray Read file include patterns from file (use - to read from stdin)
--max-age Duration Only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y (default off)
--max-depth int If set limits the recursion depth to this (default -1)
--max-size SizeSuffix Only transfer files smaller than this in KiB or suffix B|K|M|G|T|P (default off)
--max-transfer SizeSuffix Maximum size of data to transfer (default off)
--min-age Duration Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y (default off)
--min-size SizeSuffix Only transfer files bigger than this in KiB or suffix B|K|M|G|T|P (default off)
Listing
Maybe should be elsewhere?
--fast-list Use recursive list if available; uses more memory but fewer transactions
Logging
Logging and statistics stuff
--log-file string Log everything to this file
--log-format string Comma separated list of log format options (default "date,time")
--log-level string Log level DEBUG|INFO|NOTICE|ERROR (default "NOTICE")
--log-systemd Activate systemd integration for the logger
--max-stats-groups int Maximum number of stats groups to keep in memory, on max oldest is discarded (default 1000)
-P, --progress Show progress during transfer
--progress-terminal-title Show progress on the terminal title (requires -P/--progress)
-q, --quiet Print as little stuff as possible
--stats Duration Interval between printing stats, e.g. 500ms, 60s, 5m (0 to disable) (default 1m0s)
--stats-file-name-length int Max file name length in stats (0 for no limit) (default 45)
--stats-log-level string Log level to show --stats output DEBUG|INFO|NOTICE|ERROR (default "INFO")
--stats-one-line Make the stats fit on one line
--stats-one-line-date Enable --stats-one-line and add current date/time prefix
--stats-one-line-date-format string Enable --stats-one-line-date and use custom formatted date: Enclose date string in double quotes ("), see https://golang.org/pkg/time/#Time.Format
--stats-unit string Show data rate in stats as either 'bits' or 'bytes' per second (default "bytes")
--syslog Use Syslog for logging
--syslog-facility string Facility for syslog, e.g. KERN,USER,... (default "DAEMON")
--use-json-log Use json log format
-v, --verbose count Print lots more stuff (repeat for more)
Metadata
-M, --metadata If set, preserve metadata when copying objects
--metadata-exclude stringArray Exclude metadatas matching pattern
--metadata-exclude-from stringArray Read metadata exclude patterns from file (use - to read from stdin)
--metadata-filter stringArray Add a metadata filtering rule
--metadata-filter-from stringArray Read metadata filtering patterns from a file (use - to read from stdin)
--metadata-include stringArray Include metadatas matching pattern
--metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin)
--metadata-set stringArray Add metadata key=value when uploading
rc
--rc Enable the remote control server
--rc-addr stringArray IPaddress:Port or :Port to bind server to (default [localhost:5572])
--rc-allow-origin string Set the allowed origin for CORS
--rc-baseurl string Prefix for URLs - leave blank for root
--rc-cert string TLS PEM key (concatenation of certificate and CA certificate)
--rc-client-ca string Client certificate authority to verify clients with
--rc-enable-metrics Enable prometheus metrics on /metrics
--rc-files string Path to local files to serve on the HTTP server
--rc-htpasswd string A htpasswd file - if not provided no authentication is done
--rc-job-expire-duration Duration Expire finished async jobs older than this value (default 1m0s)
--rc-job-expire-interval Duration Interval to check for expired async jobs (default 10s)
--rc-key string TLS PEM Private key
--rc-max-header-bytes int Maximum size of request header (default 4096)
--rc-min-tls-version string Minimum TLS version that is acceptable (default "tls1.0")
--rc-no-auth Don't require auth for certain methods
--rc-pass string Password for authentication
--rc-realm string Realm for authentication
--rc-salt string Password hashing salt (default "dlPL2MqE")
--rc-serve Enable the serving of remote objects
--rc-server-read-timeout Duration Timeout for server reading data (default 1h0m0s)
--rc-server-write-timeout Duration Timeout for server writing data (default 1h0m0s)
--rc-template string User-specified template
--rc-user string User name for authentication
--rc-web-fetch-url string URL to fetch the releases for webgui (default "https://api.github.com/repos/rclone/rclone-webui-react/releases/latest")
--rc-web-gui Launch WebGUI on localhost
--rc-web-gui-force-update Force update to latest version of web gui
--rc-web-gui-no-open-browser Don't open the browser automatically
--rc-web-gui-update Check and update to latest version of web gui
Backend Flags
Most of the backend flags aren't generally relevant but these might be.
-L, --copy-links Follow symlinks and copy the pointed to item
-l, --links Translate symlinks to/from regular files with a '.rclonelink' extension