mirror of
https://github.com/rclone/rclone.git
synced 2025-08-15 00:02:35 +02:00
fs: add --all to rclone config create/update to ask all the config questions #3455
This also factors the config questions into a state based mechanism so a backend can be configured using the same dialog as rclone config but remotely.
This commit is contained in:
18
fs/fs.go
18
fs/fs.go
@ -157,6 +157,17 @@ func (os Options) NonDefault(m configmap.Getter) configmap.Simple {
|
||||
return nonDefault
|
||||
}
|
||||
|
||||
// HasAdvanced discovers if any options have an Advanced setting
|
||||
func (os Options) HasAdvanced() bool {
|
||||
for i := range os {
|
||||
opt := &os[i]
|
||||
if opt.Advanced {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// OptionVisibility controls whether the options are visible in the
|
||||
// configurator or the command line.
|
||||
type OptionVisibility byte
|
||||
@ -256,6 +267,13 @@ func (o *Option) EnvVarName(prefix string) string {
|
||||
return OptionToEnv(prefix + "-" + o.Name)
|
||||
}
|
||||
|
||||
// Copy makes a shallow copy of the option
|
||||
func (o *Option) Copy() *Option {
|
||||
copy := new(Option)
|
||||
*copy = *o
|
||||
return copy
|
||||
}
|
||||
|
||||
// OptionExamples is a slice of examples
|
||||
type OptionExamples []OptionExample
|
||||
|
||||
|
Reference in New Issue
Block a user