1
0
mirror of https://github.com/rclone/rclone.git synced 2025-03-23 04:34:32 +02:00
Nick Craig-Wood 874d66658e fs: fix setting stringArray config values from environment variables
After the config re-organisation, the setting of stringArray config
values (eg `--exclude` set with `RCLONE_EXCLUDE`) was broken and gave
a message like this for `RCLONE_EXCLUDE=*.jpg`:

    Failed to load "filter" default values: failed to initialise "filter" options:
    couldn't parse config item "exclude" = "*.jpg" as []string: parsing "*.jpg" as []string failed:
    invalid character '/' looking for beginning of value

This was caused by the parser trying to parse the input string as a
JSON value.

When the config was re-organised it was thought that the internal
representation of stringArray values was not important as it was never
visible externally, however this turned out not to be true.

A defined representation was chosen - a comma separated string and
this was documented and tests were introduced in this patch.

This potentially introduces a very small backwards incompatibility. In
rclone v1.67.0

    RCLONE_EXCLUDE=a,b

Would be interpreted as

    --exclude "a,b"

Whereas this new code will interpret it as

    --exclude "a" --exclude "b"

The benefit of being able to set multiple values with an environment
variable was deemed to outweigh the very small backwards compatibility
risk.

If a value with a `,` is needed, then use CSV escaping, eg

    RCLONE_EXCLUDE="a,b"

(Note this needs to have the quotes in so at the unix shell that would be

    RCLONE_EXCLUDE='"a,b"'

Fixes #8063
2024-09-13 15:52:51 +01:00
..
2024-09-08 16:21:56 +01:00
2024-08-15 17:00:39 +01:00
2024-08-17 16:00:18 +02:00
2024-09-13 15:52:51 +01:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-06-14 16:04:51 +01:00
2024-09-08 16:21:56 +01:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-06-14 16:04:51 +01:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-08-15 17:00:39 +01:00
2024-09-08 16:21:56 +01:00
2024-08-17 16:00:18 +02:00
2024-09-08 16:21:56 +01:00
2024-07-24 11:07:52 +01:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-06-14 16:04:51 +01:00
2024-06-14 16:04:51 +01:00
2022-07-06 11:25:31 +01:00
2024-06-14 16:04:51 +01:00
2024-09-08 16:21:56 +01:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-06-14 16:04:51 +01:00
2024-08-12 13:35:44 +01:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-09-08 16:21:56 +01:00
2024-06-14 16:04:51 +01:00
2024-09-08 16:21:56 +01:00
2024-06-14 16:04:51 +01:00
2024-06-14 16:04:51 +01:00
2024-07-22 14:48:41 +01:00
2024-09-08 16:21:56 +01:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-06-14 16:04:51 +01:00
2024-08-17 16:00:18 +02:00
2024-08-17 16:00:18 +02:00