rc: implement options/blocks,get,set and register options

This commit is contained in:
Nick Craig-Wood
2018-11-03 11:32:00 +00:00
parent 0bfa9811f7
commit b972dcb0ae
7 changed files with 106 additions and 0 deletions
+2
View File
@@ -12,6 +12,7 @@ import (
"github.com/ncw/rclone/fs"
"github.com/ncw/rclone/fs/config"
"github.com/ncw/rclone/fs/config/flags"
"github.com/ncw/rclone/fs/rc"
"github.com/spf13/pflag"
)
@@ -31,6 +32,7 @@ var (
// AddFlags adds the non filing system specific flags to the command
func AddFlags(flagSet *pflag.FlagSet) {
rc.AddOption("main", fs.Config)
// NB defaults which aren't the zero for the type should be set in fs/config.go NewConfig
flags.CountVarP(flagSet, &verbose, "verbose", "v", "Print lots more stuff (repeat for more)")
flags.BoolVarP(flagSet, &quiet, "quiet", "q", false, "Print as little stuff as possible")