fs: Add string alternatives for setting options over the rc

Before this change options were read and set in native format. This
means for example nanoseconds for durations or an integer for
enumerated types, which isn't very convenient for humans.

This change enables these types to be set with a string with the
syntax as used in the command line instead, so `"10s"` rather than
`10000000000` or `"DEBUG"` rather than `8` for log level.
This commit is contained in:
Nick Craig-Wood 2020-12-11 17:48:09 +00:00
parent e32f08f37b
commit ae3963e4b4
17 changed files with 516 additions and 20 deletions

View file

@ -10,13 +10,13 @@ import (
"testing"
"time"
"github.com/spf13/pflag"
"github.com/stretchr/testify/require"
"github.com/pkg/errors"
"github.com/rclone/rclone/fs/config/configmap"
"github.com/rclone/rclone/fs/fserrors"
"github.com/rclone/rclone/lib/pacer"
"github.com/spf13/pflag"
"github.com/stretchr/testify/assert"
)