docs: add minimum versions to the command pages

This commit is contained in:
albertony 2022-11-26 23:40:49 +01:00
parent d74662a751
commit 6d18f60725
65 changed files with 233 additions and 2 deletions

View File

@ -93,6 +93,9 @@ provided by a backend. Where the value is unlimited it is omitted.
Some backends does not support the ` + "`rclone about`" + ` command at all, Some backends does not support the ` + "`rclone about`" + ` command at all,
see complete list in [documentation](https://rclone.org/overview/#optional-features). see complete list in [documentation](https://rclone.org/overview/#optional-features).
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.41",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f := cmd.NewFsSrc(args) f := cmd.NewFsSrc(args)

View File

@ -30,6 +30,9 @@ rclone config.
Use the --auth-no-open-browser to prevent rclone to open auth Use the --auth-no-open-browser to prevent rclone to open auth
link in default browser automatically.`, link in default browser automatically.`,
Annotations: map[string]string{
"versionIntroduced": "v1.27",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 3, command, args) cmd.CheckArgs(1, 3, command, args)
return config.Authorize(context.Background(), args, noAutoBrowser) return config.Authorize(context.Background(), args, noAutoBrowser)

View File

@ -58,6 +58,9 @@ Pass arguments to the backend by placing them on the end of the line
Note to run these commands on a running backend then see Note to run these commands on a running backend then see
[backend/command](/rc/#backend-command) in the rc docs. [backend/command](/rc/#backend-command) in the rc docs.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.52",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(2, 1e6, command, args) cmd.CheckArgs(2, 1e6, command, args)
name, remote := args[0], args[1] name, remote := args[0], args[1]

View File

@ -115,6 +115,9 @@ var commandDefinition = &cobra.Command{
Use: "bisync remote1:path1 remote2:path2", Use: "bisync remote1:path1 remote2:path2",
Short: shortHelp, Short: shortHelp,
Long: longHelp, Long: longHelp,
Annotations: map[string]string{
"versionIntroduced": "v1.58",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
fs1, file1, fs2, file2 := cmd.NewFsSrcDstFiles(args) fs1, file1, fs2, file2 := cmd.NewFsSrcDstFiles(args)

View File

@ -25,6 +25,10 @@ var commandDefinition = &cobra.Command{
Print cache stats for a remote in JSON format Print cache stats for a remote in JSON format
`, `,
Hidden: true, Hidden: true,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
"status": "Deprecated",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fs.Logf(nil, `"rclone cachestats" is deprecated, use "rclone backend stats %s" instead`, args[0]) fs.Logf(nil, `"rclone cachestats" is deprecated, use "rclone backend stats %s" instead`, args[0])

View File

@ -57,6 +57,9 @@ the end and |--offset| and |--count| to print a section in the middle.
Note that if offset is negative it will count from the end, so Note that if offset is negative it will count from the end, so
|--offset -1 --count 1| is equivalent to |--tail 1|. |--offset -1 --count 1| is equivalent to |--tail 1|.
`, "|", "`"), `, "|", "`"),
Annotations: map[string]string{
"versionIntroduced": "v1.33",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
usedOffset := offset != 0 || count >= 0 usedOffset := offset != 0 || count >= 0
usedHead := head > 0 usedHead := head > 0

View File

@ -155,6 +155,9 @@ to check all the data.
If you supply the |--checkfile HASH| flag with a valid hash name, If you supply the |--checkfile HASH| flag with a valid hash name,
the |source:path| must point to a text file in the SUM format. the |source:path| must point to a text file in the SUM format.
`, "|", "`") + FlagsHelp, `, "|", "`") + FlagsHelp,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
var ( var (

View File

@ -37,6 +37,9 @@ that don't support hashes or if you really want to check all the data.
Note that hash values in the SUM file are treated as case insensitive. Note that hash values in the SUM file are treated as case insensitive.
`, "|", "`") + check.FlagsHelp, `, "|", "`") + check.FlagsHelp,
Annotations: map[string]string{
"versionIntroduced": "v1.56",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(3, 3, command, args) cmd.CheckArgs(3, 3, command, args)
var hashType hash.Type var hashType hash.Type

View File

@ -20,6 +20,9 @@ var commandDefinition = &cobra.Command{
Clean up the remote if possible. Empty the trash or delete old file Clean up the remote if possible. Empty the trash or delete old file
versions. Not supported by all remotes. versions. Not supported by all remotes.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.31",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -44,6 +44,9 @@ var configCommand = &cobra.Command{
remotes and manage existing ones. You may also set or remove a remotes and manage existing ones. You may also set or remove a
password to protect your configuration. password to protect your configuration.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
return config.EditConfig(context.Background()) return config.EditConfig(context.Background())
@ -54,12 +57,18 @@ var configEditCommand = &cobra.Command{
Use: "edit", Use: "edit",
Short: configCommand.Short, Short: configCommand.Short,
Long: configCommand.Long, Long: configCommand.Long,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
Run: configCommand.Run, Run: configCommand.Run,
} }
var configFileCommand = &cobra.Command{ var configFileCommand = &cobra.Command{
Use: "file", Use: "file",
Short: `Show path of configuration file in use.`, Short: `Show path of configuration file in use.`,
Annotations: map[string]string{
"versionIntroduced": "v1.38",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
config.ShowConfigLocation() config.ShowConfigLocation()
@ -69,6 +78,9 @@ var configFileCommand = &cobra.Command{
var configTouchCommand = &cobra.Command{ var configTouchCommand = &cobra.Command{
Use: "touch", Use: "touch",
Short: `Ensure configuration file exists.`, Short: `Ensure configuration file exists.`,
Annotations: map[string]string{
"versionIntroduced": "v1.56",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
config.SaveConfig() config.SaveConfig()
@ -78,6 +90,9 @@ var configTouchCommand = &cobra.Command{
var configPathsCommand = &cobra.Command{ var configPathsCommand = &cobra.Command{
Use: "paths", Use: "paths",
Short: `Show paths used for configuration, cache, temp etc.`, Short: `Show paths used for configuration, cache, temp etc.`,
Annotations: map[string]string{
"versionIntroduced": "v1.57",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
fmt.Printf("Config file: %s\n", config.GetConfigPath()) fmt.Printf("Config file: %s\n", config.GetConfigPath())
@ -89,6 +104,9 @@ var configPathsCommand = &cobra.Command{
var configShowCommand = &cobra.Command{ var configShowCommand = &cobra.Command{
Use: "show [<remote>]", Use: "show [<remote>]",
Short: `Print (decrypted) config file, or the config for a single remote.`, Short: `Print (decrypted) config file, or the config for a single remote.`,
Annotations: map[string]string{
"versionIntroduced": "v1.38",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 1, command, args) cmd.CheckArgs(0, 1, command, args)
if len(args) == 0 { if len(args) == 0 {
@ -103,6 +121,9 @@ var configShowCommand = &cobra.Command{
var configDumpCommand = &cobra.Command{ var configDumpCommand = &cobra.Command{
Use: "dump", Use: "dump",
Short: `Dump the config file as JSON.`, Short: `Dump the config file as JSON.`,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
return config.Dump() return config.Dump()
@ -112,6 +133,9 @@ var configDumpCommand = &cobra.Command{
var configProvidersCommand = &cobra.Command{ var configProvidersCommand = &cobra.Command{
Use: "providers", Use: "providers",
Short: `List in JSON format all the providers and options.`, Short: `List in JSON format all the providers and options.`,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
return config.JSONListProviders() return config.JSONListProviders()
@ -226,6 +250,9 @@ using remote authorization you would do this:
rclone config create mydrive drive config_is_local=false rclone config create mydrive drive config_is_local=false
`, "|", "`") + configPasswordHelp, `, "|", "`") + configPasswordHelp,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(2, 256, command, args) cmd.CheckArgs(2, 256, command, args)
in, err := argsToMap(args[2:]) in, err := argsToMap(args[2:])
@ -289,6 +316,9 @@ require this add an extra parameter thus:
rclone config update myremote env_auth=true config_refresh_token=false rclone config update myremote env_auth=true config_refresh_token=false
`, "|", "`") + configPasswordHelp, `, "|", "`") + configPasswordHelp,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 256, command, args) cmd.CheckArgs(1, 256, command, args)
in, err := argsToMap(args[1:]) in, err := argsToMap(args[1:])
@ -304,6 +334,9 @@ require this add an extra parameter thus:
var configDeleteCommand = &cobra.Command{ var configDeleteCommand = &cobra.Command{
Use: "delete name", Use: "delete name",
Short: "Delete an existing remote.", Short: "Delete an existing remote.",
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
config.DeleteRemote(args[0]) config.DeleteRemote(args[0])
@ -326,6 +359,9 @@ For example, to set password of a remote of name myremote you would do:
This command is obsolete now that "config update" and "config create" This command is obsolete now that "config update" and "config create"
both support obscuring passwords directly. both support obscuring passwords directly.
`, "|", "`"), `, "|", "`"),
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 256, command, args) cmd.CheckArgs(1, 256, command, args)
in, err := argsToMap(args[1:]) in, err := argsToMap(args[1:])

View File

@ -83,6 +83,9 @@ recently very efficiently like this:
**Note**: Use the |--dry-run| or the |--interactive|/|-i| flag to test without copying anything. **Note**: Use the |--dry-run| or the |--interactive|/|-i| flag to test without copying anything.
`, "|", "`"), `, "|", "`"),
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)

View File

@ -46,6 +46,9 @@ the destination.
**Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics **Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.35",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
fsrc, srcFileName, fdst, dstFileName := cmd.NewFsSrcDstFiles(args) fsrc, srcFileName, fdst, dstFileName := cmd.NewFsSrcDstFiles(args)

View File

@ -51,6 +51,9 @@ destination if there is one with the same name.
Setting ` + "`--stdout`" + ` or making the output file name ` + "`-`" + ` Setting ` + "`--stdout`" + ` or making the output file name ` + "`-`" + `
will cause the output to be written to standard output. will cause the output to be written to standard output.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.43",
},
RunE: func(command *cobra.Command, args []string) (err error) { RunE: func(command *cobra.Command, args []string) (err error) {
cmd.CheckArgs(1, 2, command, args) cmd.CheckArgs(1, 2, command, args)

View File

@ -47,6 +47,9 @@ the files in remote:path.
After it has run it will log the status of the encryptedremote:. After it has run it will log the status of the encryptedremote:.
` + check.FlagsHelp, ` + check.FlagsHelp,
Annotations: map[string]string{
"versionIntroduced": "v1.36",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
fsrc, fdst := cmd.NewFsSrcDst(args) fsrc, fdst := cmd.NewFsSrcDst(args)

View File

@ -41,6 +41,9 @@ use it like this
Another way to accomplish this is by using the ` + "`rclone backend encode` (or `decode`)" + ` command. Another way to accomplish this is by using the ` + "`rclone backend encode` (or `decode`)" + ` command.
See the documentation on the [crypt](/crypt/) overlay for more info. See the documentation on the [crypt](/crypt/) overlay for more info.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.38",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 11, command, args) cmd.CheckArgs(2, 11, command, args)
cmd.Run(false, false, command, func() error { cmd.Run(false, false, command, func() error {

View File

@ -135,6 +135,9 @@ Or
rclone dedupe rename "drive:Google Photos" rclone dedupe rename "drive:Google Photos"
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.27",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 2, command, args) cmd.CheckArgs(1, 2, command, args)
if len(args) > 1 { if len(args) > 1 {

View File

@ -53,6 +53,9 @@ delete all files bigger than 100 MiB.
**Important**: Since this can cause data loss, test first with the **Important**: Since this can cause data loss, test first with the
|--dry-run| or the |--interactive|/|-i| flag. |--dry-run| or the |--interactive|/|-i| flag.
`, "|", "`"), `, "|", "`"),
Annotations: map[string]string{
"versionIntroduced": "v1.27",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -22,6 +22,9 @@ Remove a single file from remote. Unlike ` + "`" + `delete` + "`" + ` it cannot
remove a directory and it doesn't obey include/exclude filters - if the specified file exists, remove a directory and it doesn't obey include/exclude filters - if the specified file exists,
it will always be removed. it will always be removed.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.42",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fs, fileName := cmd.NewFsFile(args[0]) fs, fileName := cmd.NewFsFile(args[0])

View File

@ -17,4 +17,7 @@ var completionDefinition = &cobra.Command{
Generates a shell completion script for rclone. Generates a shell completion script for rclone.
Run with ` + "`--help`" + ` to list the supported shells. Run with ` + "`--help`" + ` to list the supported shells.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.33",
},
} }

View File

@ -53,6 +53,9 @@ var commandDefinition = &cobra.Command{
This produces markdown docs for the rclone commands to the directory This produces markdown docs for the rclone commands to the directory
supplied. These are in a format suitable for hugo to render into the supplied. These are in a format suitable for hugo to render into the
rclone.org website.`, rclone.org website.`,
Annotations: map[string]string{
"versionIntroduced": "v1.33",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
now := time.Now().Format(time.RFC3339) now := time.Now().Format(time.RFC3339)

View File

@ -112,6 +112,9 @@ Then
Note that hash names are case insensitive and values are output in lower case. Note that hash names are case insensitive and values are output in lower case.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.41",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 2, command, args) cmd.CheckArgs(0, 2, command, args)
if len(args) == 0 { if len(args) == 0 {

View File

@ -33,6 +33,9 @@ See the home page (https://rclone.org/) for installation, usage,
documentation, changelog and configuration walkthroughs. documentation, changelog and configuration walkthroughs.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
PersistentPostRun: func(cmd *cobra.Command, args []string) { PersistentPostRun: func(cmd *cobra.Command, args []string) {
fs.Debugf("rclone", "Version %q finishing with parameters %q", fs.Version, os.Args) fs.Debugf("rclone", "Version %q finishing with parameters %q", fs.Version, os.Args)
atexit.Run() atexit.Run()

View File

@ -49,6 +49,9 @@ link. Exact capabilities depend on the remote, but the link will
always by default be created with the least constraints e.g. no always by default be created with the least constraints e.g. no
expiry, no password protection, accessible without account. expiry, no password protection, accessible without account.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.41",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc, remote := cmd.NewFsFile(args[0]) fsrc, remote := cmd.NewFsFile(args[0])

View File

@ -30,6 +30,9 @@ rclone listremotes lists all the available remotes from the config file.
When used with the ` + "`--long`" + ` flag it lists the types too. When used with the ` + "`--long`" + ` flag it lists the types too.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.34",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
remotes := config.FileSections() remotes := config.FileSections()

View File

@ -31,6 +31,9 @@ Eg
37600 fubuwic 37600 fubuwic
` + lshelp.Help, ` + lshelp.Help,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -49,6 +49,9 @@ Or
If you just want the directory names use ` + "`rclone lsf --dirs-only`" + `. If you just want the directory names use ` + "`rclone lsf --dirs-only`" + `.
` + lshelp.Help, ` + lshelp.Help,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
ci := fs.GetConfig(context.Background()) ci := fs.GetConfig(context.Background())
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)

View File

@ -142,6 +142,9 @@ those only (without traversing the whole directory structure):
rclone copy --files-from-raw new_files /path/to/local remote:path rclone copy --files-from-raw new_files /path/to/local remote:path
` + lshelp.Help, ` + lshelp.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.40",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -112,6 +112,9 @@ will be shown ("2017-05-31T16:15:57+01:00").
The whole output can be processed as a JSON blob, or alternatively it The whole output can be processed as a JSON blob, or alternatively it
can be processed line by line as each item is written one to a line. can be processed line by line as each item is written one to a line.
` + lshelp.Help, ` + lshelp.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.37",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
var fsrc fs.Fs var fsrc fs.Fs

View File

@ -31,6 +31,9 @@ Eg
37600 2016-06-25 18:55:40.814629136 fubuwic 37600 2016-06-25 18:55:40.814629136 fubuwic
` + lshelp.Help, ` + lshelp.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.02",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -38,6 +38,9 @@ by not passing a remote:path, or by passing a hyphen as remote:path
when there is data to read (if not, the hyphen will be treated literally, when there is data to read (if not, the hyphen will be treated literally,
as a relative path). as a relative path).
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.02",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 1, command, args) cmd.CheckArgs(0, 1, command, args)
if found, err := hashsum.CreateFromStdinArg(hash.MD5, args, 0); found { if found, err := hashsum.CreateFromStdinArg(hash.MD5, args, 0); found {

View File

@ -18,6 +18,9 @@ func init() {
var commandDefinition = &cobra.Command{ var commandDefinition = &cobra.Command{
Use: "mkdir remote:path", Use: "mkdir remote:path",
Short: `Make the path if it doesn't already exist.`, Short: `Make the path if it doesn't already exist.`,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fdst := cmd.NewFsDir(args) fdst := cmd.NewFsDir(args)

View File

@ -157,6 +157,9 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
Hidden: hidden, Hidden: hidden,
Short: `Mount the remote as file system on a mountpoint.`, Short: `Mount the remote as file system on a mountpoint.`,
Long: strings.ReplaceAll(strings.ReplaceAll(mountHelp, "|", "`"), "@", commandName) + vfs.Help, Long: strings.ReplaceAll(strings.ReplaceAll(mountHelp, "|", "`"), "@", commandName) + vfs.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.33",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)

View File

@ -60,6 +60,9 @@ can speed transfers up greatly.
**Note**: Use the |-P|/|--progress| flag to view real-time transfer statistics. **Note**: Use the |-P|/|--progress| flag to view real-time transfer statistics.
`, "|", "`"), `, "|", "`"),
Annotations: map[string]string{
"versionIntroduced": "v1.19",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args) fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args)

View File

@ -49,6 +49,9 @@ successful transfer.
**Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics. **Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.35",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
fsrc, srcFileName, fdst, dstFileName := cmd.NewFsSrcDstFiles(args) fsrc, srcFileName, fdst, dstFileName := cmd.NewFsSrcDstFiles(args)

View File

@ -74,6 +74,9 @@ For a non-interactive listing of the remote, see the
[tree](/commands/rclone_tree/) command. To just get the total size of [tree](/commands/rclone_tree/) command. To just get the total size of
the remote you can also use the [size](/commands/rclone_size/) command. the remote you can also use the [size](/commands/rclone_size/) command.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.37",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -42,6 +42,9 @@ obfuscating the hyphen itself.
If you want to encrypt the config file then please use config file If you want to encrypt the config file then please use config file
encryption - see [rclone config](/commands/rclone_config/) for more encryption - see [rclone config](/commands/rclone_config/) for more
info.`, info.`,
Annotations: map[string]string{
"versionIntroduced": "v1.36",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
var password string var password string

View File

@ -26,6 +26,9 @@ delete files. To delete empty directories only, use command
**Important**: Since this can cause data loss, test first with the **Important**: Since this can cause data loss, test first with the
` + "`--dry-run` or the `--interactive`/`-i`" + ` flag. ` + "`--dry-run` or the `--interactive`/`-i`" + ` flag.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fdst := cmd.NewFsDir(args) fdst := cmd.NewFsDir(args)

View File

@ -99,6 +99,9 @@ rclone rc server, e.g.:
rclone rc --loopback operations/about fs=/ rclone rc --loopback operations/about fs=/
Use ` + "`rclone rc`" + ` to see a list of all possible commands.`, Use ` + "`rclone rc`" + ` to see a list of all possible commands.`,
Annotations: map[string]string{
"versionIntroduced": "v1.40",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 1e9, command, args) cmd.CheckArgs(0, 1e9, command, args)
cmd.Run(false, false, command, func() error { cmd.Run(false, false, command, func() error {

View File

@ -56,6 +56,9 @@ Note that the upload can also not be retried because the data is
not kept around until the upload succeeds. If you need to transfer not kept around until the upload succeeds. If you need to transfer
a lot of data, you're better off caching locally and then a lot of data, you're better off caching locally and then
` + "`rclone move`" + ` it to the destination.`, ` + "`rclone move`" + ` it to the destination.`,
Annotations: map[string]string{
"versionIntroduced": "v1.38",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)

View File

@ -32,6 +32,9 @@ the browser when rclone is run.
See the [rc documentation](/rc/) for more info on the rc flags. See the [rc documentation](/rc/) for more info on the rc flags.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.45",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 1, command, args) cmd.CheckArgs(0, 1, command, args)
if rcflags.Opt.Enabled { if rcflags.Opt.Enabled {

View File

@ -16,6 +16,9 @@ func init() {
var commandDefinition = &cobra.Command{ var commandDefinition = &cobra.Command{
Use: "reveal password", Use: "reveal password",
Short: `Reveal obscured password from rclone.conf`, Short: `Reveal obscured password from rclone.conf`,
Annotations: map[string]string{
"versionIntroduced": "v1.43",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
cmd.Run(false, false, command, func() error { cmd.Run(false, false, command, func() error {

View File

@ -24,6 +24,9 @@ with option ` + "`--rmdirs`" + `) to do that.
To delete a path and any objects in it, use [purge](/commands/rclone_purge/) command. To delete a path and any objects in it, use [purge](/commands/rclone_purge/) command.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fdst := cmd.NewFsDir(args) fdst := cmd.NewFsDir(args)

View File

@ -38,6 +38,9 @@ used with option ` + "`--rmdirs`" + `).
To delete a path and any objects in it, use [purge](/commands/rclone_purge/) To delete a path and any objects in it, use [purge](/commands/rclone_purge/)
command. command.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.35",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fdst := cmd.NewFsDir(args) fdst := cmd.NewFsDir(args)

View File

@ -64,6 +64,9 @@ var cmdSelfUpdate = &cobra.Command{
Aliases: []string{"self-update"}, Aliases: []string{"self-update"},
Short: `Update the rclone binary.`, Short: `Update the rclone binary.`,
Long: strings.ReplaceAll(selfUpdateHelp, "|", "`"), Long: strings.ReplaceAll(selfUpdateHelp, "|", "`"),
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
if Opt.Package == "" { if Opt.Package == "" {

View File

@ -47,6 +47,9 @@ media transcoding support. This means that some players might show
files that they are not able to play back correctly. files that they are not able to play back correctly.
` + dlnaflags.Help + vfs.Help, ` + dlnaflags.Help + vfs.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.46",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f := cmd.NewFsSrc(args) f := cmd.NewFsSrc(args)

View File

@ -48,7 +48,9 @@ var Command = &cobra.Command{
Use: "docker", Use: "docker",
Short: `Serve any remote on docker's volume plugin API.`, Short: `Serve any remote on docker's volume plugin API.`,
Long: strings.ReplaceAll(longHelp, "|", "`") + vfs.Help, Long: strings.ReplaceAll(longHelp, "|", "`") + vfs.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.56",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
cmd.Run(false, false, command, func() error { cmd.Run(false, false, command, func() error {

View File

@ -99,6 +99,9 @@ By default this will serve files without needing a login.
You can set a single username and password with the --user and --pass flags. 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",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
var f fs.Fs var f fs.Fs
if proxyflags.Opt.AuthProxy == "" { if proxyflags.Opt.AuthProxy == "" {

View File

@ -60,6 +60,9 @@ The server will log errors. Use ` + "`-v`" + ` to see access logs.
` + "`--bwlimit`" + ` will be respected for file transfers. Use ` + "`--stats`" + ` to ` + "`--bwlimit`" + ` will be respected for file transfers. Use ` + "`--stats`" + ` to
control the stats printing. control the stats printing.
` + httplib.Help + data.Help + auth.Help + vfs.Help, ` + httplib.Help + data.Help + auth.Help + vfs.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f := cmd.NewFsSrc(args) f := cmd.NewFsSrc(args)

View File

@ -128,6 +128,9 @@ these **must** end with /. Eg
The` + "`--private-repos`" + ` flag can be used to limit users to repositories starting The` + "`--private-repos`" + ` flag can be used to limit users to repositories starting
with a path of ` + "`/<username>/`" + `. with a path of ` + "`/<username>/`" + `.
` + httplib.Help, ` + httplib.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.40",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f := cmd.NewFsSrc(args) f := cmd.NewFsSrc(args)

View File

@ -49,6 +49,9 @@ subcommand to specify the protocol, e.g.
Each subcommand has its own options which you can see in their help. Each subcommand has its own options which you can see in their help.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
if len(args) == 0 { if len(args) == 0 {
return errors.New("serve requires a protocol, e.g. 'rclone serve http remote:'") return errors.New("serve requires a protocol, e.g. 'rclone serve http remote:'")

View File

@ -114,6 +114,9 @@ checksumming is possible but less secure and you could use the SFTP server
provided by OpenSSH in this case. provided by OpenSSH in this case.
` + vfs.Help + proxy.Help, ` + vfs.Help + proxy.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.48",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
var f fs.Fs var f fs.Fs
if proxyflags.Opt.AuthProxy == "" { if proxyflags.Opt.AuthProxy == "" {

View File

@ -61,6 +61,9 @@ supported hash on the backend or you can use a named hash such as
to see the full list. to see the full list.
` + httplib.Help + vfs.Help + proxy.Help, ` + httplib.Help + vfs.Help + proxy.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
var f fs.Fs var f fs.Fs
if proxyflags.Opt.AuthProxy == "" { if proxyflags.Opt.AuthProxy == "" {

View File

@ -40,6 +40,9 @@ Or just provide remote directory and all files in directory will be tiered
rclone settier tier remote:path/dir rclone settier tier remote:path/dir
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.44",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
tier := args[0] tier := args[0]

View File

@ -41,6 +41,9 @@ as a relative path).
This command can also hash data received on STDIN, if not passing This command can also hash data received on STDIN, if not passing
a remote:path. a remote:path.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.27",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 1, command, args) cmd.CheckArgs(0, 1, command, args)
if found, err := hashsum.CreateFromStdinArg(hash.SHA1, args, 0); found { if found, err := hashsum.CreateFromStdinArg(hash.SHA1, args, 0); found {

View File

@ -44,6 +44,9 @@ Rclone will then show a notice in the log indicating how many such
files were encountered, and count them in as empty files in the output files were encountered, and count them in as empty files in the output
of the size command. of the size command.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.23",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -60,6 +60,9 @@ destination that is inside the source directory.
**Note**: Use the ` + "`rclone dedupe`" + ` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. **Note**: Use the ` + "`rclone dedupe`" + ` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors.
See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14372) for more info. See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14372) for more info.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v0.90",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args) cmd.CheckArgs(2, 2, command, args)
fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args) fsrc, srcFileName, fdst := cmd.NewFsSrcFileDst(args)

View File

@ -26,6 +26,9 @@ func init() {
var commandDefinition = &cobra.Command{ var commandDefinition = &cobra.Command{
Use: "changenotify remote:", Use: "changenotify remote:",
Short: `Log any change notify requests for the remote passed in.`, Short: `Log any change notify requests for the remote passed in.`,
Annotations: map[string]string{
"versionIntroduced": "v1.56",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f := cmd.NewFsSrc(args) f := cmd.NewFsSrc(args)

View File

@ -28,6 +28,9 @@ in filenames in the remote:path specified.
The data doesn't contain any identifying information but is useful for The data doesn't contain any identifying information but is useful for
the rclone developers when developing filename compression. the rclone developers when developing filename compression.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f := cmd.NewFsDir(args) f := cmd.NewFsDir(args)

View File

@ -66,6 +66,9 @@ a bit of go code for each one.
**NB** this can create undeletable files and other hazards - use with care **NB** this can create undeletable files and other hazards - use with care
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1e6, command, args) cmd.CheckArgs(1, 1e6, command, args)
if !checkNormalization && !checkControl && !checkLength && !checkStreaming && !all { if !checkNormalization && !checkControl && !checkLength && !checkStreaming && !all {

View File

@ -74,6 +74,9 @@ func init() {
var makefilesCmd = &cobra.Command{ var makefilesCmd = &cobra.Command{
Use: "makefiles <dir>", Use: "makefiles <dir>",
Short: `Make a random file hierarchy in a directory`, Short: `Make a random file hierarchy in a directory`,
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
commonInit() commonInit()
@ -105,6 +108,9 @@ var makefilesCmd = &cobra.Command{
var makefileCmd = &cobra.Command{ var makefileCmd = &cobra.Command{
Use: "makefile <size> [<file>]+ [flags]", Use: "makefile <size> [<file>]+ [flags]",
Short: `Make files with random contents of the size given`, Short: `Make files with random contents of the size given`,
Annotations: map[string]string{
"versionIntroduced": "v1.59",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1e6, command, args) cmd.CheckArgs(1, 1e6, command, args)
commonInit() commonInit()

View File

@ -20,6 +20,9 @@ func init() {
var commandDefinition = &cobra.Command{ var commandDefinition = &cobra.Command{
Use: "memory remote:path", Use: "memory remote:path",
Short: `Load all the objects at remote:path into memory and report memory stats.`, Short: `Load all the objects at remote:path into memory and report memory stats.`,
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -25,4 +25,7 @@ Each subcommand has its own options which you can see in their help.
**NB** Be careful running these commands, they may do strange things **NB** Be careful running these commands, they may do strange things
so reading their documentation first is recommended. so reading their documentation first is recommended.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},
} }

View File

@ -64,6 +64,9 @@ time instead of the current time. Times may be specified as one of:
Note that value of ` + "`--timestamp`" + ` is in UTC. If you want local time Note that value of ` + "`--timestamp`" + ` is in UTC. If you want local time
then add the ` + "`--localtime`" + ` flag. then add the ` + "`--localtime`" + ` flag.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.39",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
f, remote := newFsDst(args) f, remote := newFsDst(args)

View File

@ -95,6 +95,9 @@ short options as they conflict with rclone's short options.
For a more interactive navigation of the remote see the For a more interactive navigation of the remote see the
[ncdu](/commands/rclone_ncdu/) command. [ncdu](/commands/rclone_ncdu/) command.
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.38",
},
RunE: func(command *cobra.Command, args []string) error { RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args) cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args) fsrc := cmd.NewFsSrc(args)

View File

@ -67,6 +67,9 @@ Or
upgrade: https://beta.rclone.org/v1.42-005-g56e1e820 upgrade: https://beta.rclone.org/v1.42-005-g56e1e820
`, `,
Annotations: map[string]string{
"versionIntroduced": "v1.33",
},
Run: func(command *cobra.Command, args []string) { Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args) cmd.CheckArgs(0, 0, command, args)
if check { if check {