serve/http: fix --disable-zip so it works over rc
The --disable-zip flag was registered manually and was missing from OptionsInfo, so it could not be set over the rc interface. Move it into OptionsInfo like serve webdav does, which keeps the command line flag and also makes it settable via rc.
This commit is contained in:
@@ -35,7 +35,11 @@ import (
|
||||
)
|
||||
|
||||
// OptionsInfo describes the Options in use
|
||||
var OptionsInfo = fs.Options{}.
|
||||
var OptionsInfo = fs.Options{{
|
||||
Name: "disable_zip",
|
||||
Default: false,
|
||||
Help: "Disable zip download of directories",
|
||||
}}.
|
||||
Add(libhttp.ConfigInfo).
|
||||
Add(libhttp.AuthConfigInfo).
|
||||
Add(libhttp.TemplateConfigInfo)
|
||||
@@ -45,7 +49,7 @@ type Options struct {
|
||||
Auth libhttp.AuthConfig
|
||||
HTTP libhttp.Config
|
||||
Template libhttp.TemplateConfig
|
||||
DisableZip bool
|
||||
DisableZip bool `config:"disable_zip"`
|
||||
}
|
||||
|
||||
// DefaultOpt is the default values used for Options
|
||||
@@ -74,7 +78,6 @@ func init() {
|
||||
flags.AddFlagsFromOptions(flagSet, "", OptionsInfo)
|
||||
vfsflags.AddFlags(flagSet)
|
||||
proxyflags.AddFlags(flagSet)
|
||||
flagSet.BoolVar(&Opt.DisableZip, "disable-zip", false, "Disable zip download of directories")
|
||||
cmdserve.Command.AddCommand(Command)
|
||||
cmdserve.AddRc("http", func(ctx context.Context, f fs.Fs, in rc.Params) (cmdserve.Handle, error) {
|
||||
// Read VFS Opts
|
||||
|
||||
Reference in New Issue
Block a user