diff --git a/cmd/serve/restic/restic.go b/cmd/serve/restic/restic.go index aebbd4138..f19b1d37c 100644 --- a/cmd/serve/restic/restic.go +++ b/cmd/serve/restic/restic.go @@ -17,6 +17,7 @@ import ( "github.com/rclone/rclone/cmd/serve/httplib/serve" "github.com/rclone/rclone/fs" "github.com/rclone/rclone/fs/accounting" + "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/fs/fserrors" "github.com/rclone/rclone/fs/operations" "github.com/rclone/rclone/fs/walk" @@ -33,9 +34,10 @@ var ( func init() { httpflags.AddFlags(Command.Flags()) - Command.Flags().BoolVar(&stdio, "stdio", false, "run an HTTP2 server on stdin/stdout") - Command.Flags().BoolVar(&appendOnly, "append-only", false, "disallow deletion of repository data") - Command.Flags().BoolVar(&privateRepos, "private-repos", false, "users can only access their private repo") + flagSet := Command.Flags() + flags.BoolVarP(flagSet, &stdio, "stdio", "", false, "run an HTTP2 server on stdin/stdout") + flags.BoolVarP(flagSet, &appendOnly, "append-only", "", false, "disallow deletion of repository data") + flags.BoolVarP(flagSet, &privateRepos, "private-repos", "", false, "users can only access their private repo") } // Command definition for cobra diff --git a/cmd/serve/webdav/webdav.go b/cmd/serve/webdav/webdav.go index 377b17ba8..37cc34860 100644 --- a/cmd/serve/webdav/webdav.go +++ b/cmd/serve/webdav/webdav.go @@ -15,6 +15,7 @@ import ( "github.com/rclone/rclone/cmd/serve/proxy" "github.com/rclone/rclone/cmd/serve/proxy/proxyflags" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config/flags" "github.com/rclone/rclone/fs/hash" "github.com/rclone/rclone/lib/errors" "github.com/rclone/rclone/vfs" @@ -30,11 +31,12 @@ var ( ) func init() { - httpflags.AddFlags(Command.Flags()) - vfsflags.AddFlags(Command.Flags()) - proxyflags.AddFlags(Command.Flags()) - Command.Flags().StringVar(&hashName, "etag-hash", "", "Which hash to use for the ETag, or auto or blank for off") - Command.Flags().BoolVar(&disableGETDir, "disable-dir-list", false, "Disable HTML directory list on GET request for a directory") + flagSet := Command.Flags() + httpflags.AddFlags(flagSet) + vfsflags.AddFlags(flagSet) + proxyflags.AddFlags(flagSet) + flags.StringVarP(flagSet, &hashName, "etag-hash", "", "", "Which hash to use for the ETag, or auto or blank for off") + flags.BoolVarP(flagSet, &disableGETDir, "disable-dir-list", "", false, "Disable HTML directory list on GET request for a directory") } // Command definition for cobra