Allow all options to be set from environment variables

The option names are munged changing - to _ making upper case and
prepending RCLONE_.  The values are as parsed by pflag.
This commit is contained in:
Nick Craig-Wood 2016-12-20 15:50:46 +00:00
parent 3b0f944e23
commit 0d75d2585f
14 changed files with 571 additions and 478 deletions

View file

@ -14,7 +14,6 @@ import (
"github.com/ncw/rclone/fs"
"github.com/ncw/swift"
"github.com/pkg/errors"
"github.com/spf13/pflag"
)
// Constants
@ -83,7 +82,7 @@ func init() {
},
})
// snet = flag.Bool("swift-snet", false, "Use internal service network") // FIXME not implemented
pflag.VarP(&chunkSize, "swift-chunk-size", "", "Above this size files will be chunked into a _segments container.")
fs.VarP(&chunkSize, "swift-chunk-size", "", "Above this size files will be chunked into a _segments container.")
}
// Fs represents a remote swift server