"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
docs: ensure empty line between text and a following heading
albertonye739ee2c27de
diff --git a/cmd/mountlib/mount.go b/cmd/mountlib/mount.goindex 739c83ff4..c8c0ac6fb 100644--- a/cmd/mountlib/mount.go+++ b/cmd/mountlib/mount.go@@ -31,6 +31,11 @@ import (//go:embed mount.mdvar mountHelp string+// help returns the help string cleaned up to simplify appending+func help(commandName string) string {+ return strings.TrimSpace(strings.ReplaceAll(mountHelp, "@", commandName)) + "\n\n"+}+// Options for creating the mounttype Options struct {DebugFUSE bool@@ -196,7 +201,7 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.CommUse: commandName + " remote:path /path/to/mountpoint",Hidden: hidden,Short: `Mount the remote as file system on a mountpoint.`,- Long: strings.ReplaceAll(mountHelp, "@", commandName) + vfs.Help,+ Long: help(commandName) + vfs.Help(),Annotations: map[string]string{"versionIntroduced": "v1.33","groups": "Filter",diff --git a/cmd/mountlib/mount.md b/cmd/mountlib/mount.mdindex 0e38323b3..bd8bd3bd7 100644--- a/cmd/mountlib/mount.md+++ b/cmd/mountlib/mount.md@@ -1,6 +1,5 @@-rclone @ allows Linux, FreeBSD, macOS and Windows to-mount any of Rclone's cloud storage systems as a file system with-FUSE.+Rclone @ allows Linux, FreeBSD, macOS and Windows to+mount any of Rclone's cloud storage systems as a file system with FUSE.First set up your remote using `rclone config`. Check it works with `rclone ls` etc.diff --git a/cmd/rcd/rcd.go b/cmd/rcd/rcd.goindex c023931f0..5d4e1dd0f 100644--- a/cmd/rcd/rcd.go+++ b/cmd/rcd/rcd.go@@ -20,8 +20,7 @@ func init() {var commandDefinition = &cobra.Command{Use: "rcd <path to files to serve>*",Short: `Run rclone listening to remote control commands only.`,- Long: `-This runs rclone so that it only listens to remote control commands.+ Long: `This runs rclone so that it only listens to remote control commands.This is useful if you are controlling rclone via the rc API.@@ -30,6 +29,7 @@ for GET requests on the URL passed in. It will also open the URL inthe browser when rclone is run.See the [rc documentation](/rc/) for more info on the rc flags.+` + libhttp.Help(rcflags.FlagPrefix) + libhttp.TemplateHelp(rcflags.FlagPrefix) + libhttp.AuthHelp(rcflags.FlagPrefix),Annotations: map[string]string{"versionIntroduced": "v1.45",diff --git a/cmd/serve/dlna/dlna.go b/cmd/serve/dlna/dlna.goindex 7739c910f..86251508d 100644--- a/cmd/serve/dlna/dlna.go+++ b/cmd/serve/dlna/dlna.go@@ -50,7 +50,7 @@ based on media formats or file extensions. Additionally, there is nomedia transcoding support. This means that some players might showfiles that they are not able to play back correctly.-` + dlnaflags.Help + vfs.Help,+` + dlnaflags.Help + vfs.Help(),Annotations: map[string]string{"versionIntroduced": "v1.46","groups": "Filter",diff --git a/cmd/serve/dlna/dlnaflags/dlnaflags.go b/cmd/serve/dlna/dlnaflags/dlnaflags.goindex 8b2f39304..3a4da76ab 100644--- a/cmd/serve/dlna/dlnaflags/dlnaflags.go+++ b/cmd/serve/dlna/dlnaflags/dlnaflags.go@@ -10,8 +10,7 @@ import ()// Help contains the text for the command line help and manual.-var Help = `-### Server options+var Help = `### Server optionsUse ` + "`--addr`" + ` to specify which IP address and port the server shouldlisten on, e.g. ` + "`--addr 1.2.3.4:8000` or `--addr :8080`" + ` to listen to all@@ -22,6 +21,7 @@ default "rclone (hostname)".Use ` + "`--log-trace` in conjunction with `-vv`" + ` to enable additional debuglogging of all UPNP traffic.+`// Options is the type for DLNA serving options.diff --git a/cmd/serve/docker/docker.go b/cmd/serve/docker/docker.goindex 9493f7407..a13ceb490 100644--- a/cmd/serve/docker/docker.go+++ b/cmd/serve/docker/docker.go@@ -5,6 +5,7 @@ import ("context"_ "embed""path/filepath"+ "strings""syscall""github.com/spf13/cobra"@@ -33,6 +34,11 @@ var (//go:embed docker.mdvar longHelp string+// help returns the help string cleaned up to simplify appending+func help() string {+ return strings.TrimSpace(longHelp) + "\n\n"+}+func init() {cmdFlags := Command.Flags()// Add command specific flags@@ -50,7 +56,7 @@ func init() {var Command = &cobra.Command{Use: "docker",Short: `Serve any remote on docker's volume plugin API.`,- Long: longHelp + vfs.Help,+ Long: help() + vfs.Help(),Annotations: map[string]string{"versionIntroduced": "v1.56","groups": "Filter",diff --git a/cmd/serve/ftp/ftp.go b/cmd/serve/ftp/ftp.goindex 2750e6458..a07386305 100644--- a/cmd/serve/ftp/ftp.go+++ b/cmd/serve/ftp/ftp.go@@ -80,8 +80,7 @@ func init() {var Command = &cobra.Command{Use: "ftp remote:path",Short: `Serve remote:path over FTP.`,- Long: `-Run a basic FTP server to serve a remote over FTP protocol.+ Long: `Run a basic FTP server to serve a remote over FTP protocol.This can be viewed with a FTP client or you can make a remote oftype FTP to read and write it.@@ -100,7 +99,8 @@ then using Authentication is advised - see the next section for info.By default this will serve files without needing a login.You can set a single username and password with the --user and --pass flags.-` + vfs.Help + proxy.Help,++` + vfs.Help() + proxy.Help,Annotations: map[string]string{"versionIntroduced": "v1.44","groups": "Filter",diff --git a/cmd/serve/http/http.go b/cmd/serve/http/http.goindex e3e373acc..5df63d17a 100644--- a/cmd/serve/http/http.go+++ b/cmd/serve/http/http.go@@ -73,7 +73,8 @@ The server will log errors. Use ` + "`-v`" + ` to see access logs.` + "`--bwlimit`" + ` will be respected for file transfers. Use ` + "`--stats`" + ` tocontrol the stats printing.-` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help + proxy.Help,++` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help() + proxy.Help,Annotations: map[string]string{"versionIntroduced": "v1.39","groups": "Filter",diff --git a/cmd/serve/nfs/nfs.go b/cmd/serve/nfs/nfs.goindex 4ef481878..b35931dec 100644--- a/cmd/serve/nfs/nfs.go+++ b/cmd/serve/nfs/nfs.go@@ -92,7 +92,7 @@ Where ` + "`$PORT`" + ` is the same port number we used in the serve nfs commandThis feature is only available on Unix platforms.-` + vfs.Help,+` + vfs.Help(),Annotations: map[string]string{"versionIntroduced": "v1.65","groups": "Filter",diff --git a/cmd/serve/proxy/proxy.go b/cmd/serve/proxy/proxy.goindex 6cff1782c..578250f9f 100644--- a/cmd/serve/proxy/proxy.go+++ b/cmd/serve/proxy/proxy.go@@ -23,8 +23,7 @@ import ()// Help contains text describing how to use the proxy-var Help = strings.Replace(`-### Auth Proxy+var Help = strings.Replace(`### Auth ProxyIf you supply the parameter |--auth-proxy /path/to/program| thenrclone will use that program to generate backends on the fly which@@ -104,6 +103,7 @@ before it takes effect.This can be used to build general purpose proxies to any kind ofbackend that rclone supports.+`, "|", "`", -1)// Options is options for creating the proxydiff --git a/cmd/serve/restic/restic.go b/cmd/serve/restic/restic.goindex 396ef1ebf..1ef186a44 100644--- a/cmd/serve/restic/restic.go+++ b/cmd/serve/restic/restic.go@@ -147,6 +147,7 @@ these **must** end with /. EgThe` + "`--private-repos`" + ` flag can be used to limit users to repositories startingwith a path of ` + "`/<username>/`" + `.+` + libhttp.Help(flagPrefix) + libhttp.AuthHelp(flagPrefix),Annotations: map[string]string{"versionIntroduced": "v1.40",diff --git a/cmd/serve/s3/s3.go b/cmd/serve/s3/s3.goindex db9e38491..07f56ed20 100644--- a/cmd/serve/s3/s3.go+++ b/cmd/serve/s3/s3.go@@ -3,6 +3,7 @@ package s3import ("context"_ "embed"+ "strings""github.com/rclone/rclone/cmd""github.com/rclone/rclone/fs/config/flags"@@ -40,6 +41,11 @@ func init() {//go:embed serve_s3.mdvar serveS3Help string+// help returns the help string cleaned up to simplify appending+func help() string {+ return strings.TrimSpace(serveS3Help) + "\n\n"+}+// Command definition for cobravar Command = &cobra.Command{Annotations: map[string]string{@@ -49,7 +55,7 @@ var Command = &cobra.Command{},Use: "s3 remote:path",Short: `Serve remote:path over s3.`,- Long: serveS3Help + httplib.Help(flagPrefix) + vfs.Help,+ Long: help() + httplib.Help(flagPrefix) + vfs.Help(),RunE: func(command *cobra.Command, args []string) error {cmd.CheckArgs(1, 1, command, args)f := cmd.NewFsSrc(args)diff --git a/cmd/serve/sftp/sftp.go b/cmd/serve/sftp/sftp.goindex 117f3ff61..495de5157 100644--- a/cmd/serve/sftp/sftp.go+++ b/cmd/serve/sftp/sftp.go@@ -114,7 +114,7 @@ used. Omitting "restrict" and using ` + "`--sftp-path-override`" + ` to enablechecksumming is possible but less secure and you could use the SFTP serverprovided by OpenSSH in this case.-` + vfs.Help + proxy.Help,+` + vfs.Help() + proxy.Help,Annotations: map[string]string{"versionIntroduced": "v1.48","groups": "Filter",diff --git a/cmd/serve/webdav/webdav.go b/cmd/serve/webdav/webdav.goindex e40eb6508..b91a80253 100644--- a/cmd/serve/webdav/webdav.go+++ b/cmd/serve/webdav/webdav.go@@ -89,6 +89,7 @@ supported hash on the backend or you can use a named hash such asto see the full list.### Access WebDAV on Windows+WebDAV shared folder can be mapped as a drive on Windows, however the default settings prevent it.Windows will fail to connect to the server using insecure Basic authentication.It will not even display any login dialog. Windows requires SSL / HTTPS connection to be used with Basic.@@ -104,6 +105,7 @@ If required, increase the FileSizeLimitInBytes to a higher value.Navigate to the Services interface, then restart the WebClient service.### Access Office applications on WebDAV+Navigate to following registry HKEY_CURRENT_USER\Software\Microsoft\Office\[14.0/15.0/16.0]\Common\InternetCreate a new DWORD BasicAuthLevel with value 2.0 - Basic authentication disabled@@ -112,7 +114,7 @@ Create a new DWORD BasicAuthLevel with value 2.https://learn.microsoft.com/en-us/office/troubleshoot/powerpoint/office-opens-blank-from-sharepoint-` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help + proxy.Help,+` + libhttp.Help(flagPrefix) + libhttp.TemplateHelp(flagPrefix) + libhttp.AuthHelp(flagPrefix) + vfs.Help() + proxy.Help,Annotations: map[string]string{"versionIntroduced": "v1.39","groups": "Filter",diff --git a/lib/http/auth.go b/lib/http/auth.goindex 6b5ce6eb5..273d9068e 100644--- a/lib/http/auth.go+++ b/lib/http/auth.go@@ -11,8 +11,7 @@ import (// AuthHelp returns text describing the http authentication to add to the command help.func AuthHelp(prefix string) string {- help := `-#### Authentication+ help := `#### AuthenticationBy default this will serve files without needing a login.@@ -38,6 +37,7 @@ The password file can be updated while rclone is running.Use ` + "`--{{ .Prefix }}realm`" + ` to set the authentication realm.Use ` + "`--{{ .Prefix }}salt`" + ` to change the password hashing salt from the default.+`tmpl, err := template.New("auth help").Parse(help)if err != nil {diff --git a/lib/http/server.go b/lib/http/server.goindex 68de85e50..fff3a2b0e 100644--- a/lib/http/server.go+++ b/lib/http/server.go@@ -27,8 +27,7 @@ import (// Help returns text describing the http server to add to the command// help.func Help(prefix string) string {- help := `-### Server options+ help := `### Server optionsUse ` + "`--{{ .Prefix }}addr`" + ` to specify which IP address and port the server shouldlisten on, eg ` + "`--{{ .Prefix }}addr 1.2.3.4:8000` or `--{{ .Prefix }}addr :8080`" + ` to listen to all@@ -74,6 +73,7 @@ certificate authority certificate.--{{ .Prefix }}min-tls-version is minimum TLS version that is acceptable. Validvalues are "tls1.0", "tls1.1", "tls1.2" and "tls1.3" (default"tls1.0").+`tmpl, err := template.New("server help").Parse(help)if err != nil {diff --git a/lib/http/template.go b/lib/http/template.goindex db50d6d89..e46e06ba8 100644--- a/lib/http/template.go+++ b/lib/http/template.go@@ -16,8 +16,7 @@ import (// TemplateHelp returns a string that describes how to use a custom templatefunc TemplateHelp(prefix string) string {- help := `-#### Template+ help := `#### Template` + "`--{{ .Prefix }}template`" + ` allows a user to specify a custom markup template for HTTPand WebDAV serve functions. The server exports the following markup@@ -52,6 +51,7 @@ be used to render HTML based on specific conditions.| contains | Checks whether a given substring is present or not in a given string. || hasPrefix | Checks whether the given string begins with the specified prefix. || hasSuffix | Checks whether the given string end with the specified suffix. |+`tmpl, err := template.New("template help").Parse(help)diff --git a/vfs/vfs.go b/vfs/vfs.goindex 2e35dc810..82cb75962 100644--- a/vfs/vfs.go+++ b/vfs/vfs.go@@ -43,10 +43,13 @@ import ("github.com/rclone/rclone/vfs/vfscommon")-// Help for the VFS.-////go:embed vfs.md-var Help string+var help string++// Help returns the help string cleaned up to simplify appending+func Help() string {+ return strings.TrimSpace(help) + "\n\n"+}// Node represents either a directory (*Dir) or a file (*File)type Node interface {