serve/start allows using the snake_case options returned from options/info
options/info also returns snake_case options for "main" and "filter" options blocks (_config and _filter respectively)
I propose allowing for _filter='{"metadata_exclude": ["foo"]}' and _config='{"size_only":true}'
what is returned from options/local would still be PascalCase go struct, but it allows sending snake_case Name fields already defined in rclone. This would not touch other camelCase options like createEmptySrcDirs or srcFs - these stay the same - only options returned from options/info would be allowed to be submitted via snake_case
The motivation is:
- alignment with other calls
- it's more friendly for software which interacts with rclone and allows config (PascalCase is not common for configuration in software)
- fully backwards compatible
- I have seen other threads where the intuitive thing is snake_case in these _config style inputs, confusing users
I have this working locally
rclone on master [!] via 🐹 v1.26.4-X:nodwarf5
❯ rclone --config /dev/null rc --loopback options/local _filter='{"metadata_exclude": ["foo"]}' | grep -i excluderule -A 1
"ExcludeRule": [],
"FilesFrom": [],
--
"ExcludeRule": [
"foo"
rclone on master [!] via 🐹 v1.26.4-X:nodwarf5
❯ rclone --config /dev/null rc --loopback options/local _config='{"size_only":true}' | grep -i sizeonly
"SizeOnly": true,
If accepted, I will be very willing to file an issue and open a PR
rclone on master [!] via 🐹 v1.26.4-X:nodwarf5
❯ git diff --stat
docs/content/rc.md | 24 +++++++++++++++++++++++-
fs/config/configstruct/configstruct.go | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
fs/config/configstruct/configstruct_test.go | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fs/rc/config.go | 18 +++++++++++++++---
fs/rc/config_test.go | 37 +++++++++++++++++++++++++++++++++++++
fs/rc/jobs/job.go | 40 ++++++++++++++++++++++++++++++++--------
fs/rc/jobs/job_test.go | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 313 insertions(+), 12 deletions(-)
Thank you for this wonderful software!