docs: factor large docs into separate .md files to make them easier to maintain.

We then use the go embed command to embed them back into the binary.
This commit is contained in:
Nick Craig-Wood
2023-10-05 15:32:50 +01:00
parent e67157cf46
commit 831d1df67f
8 changed files with 164 additions and 178 deletions

View File

@ -10,6 +10,7 @@ import (
"bytes"
"context"
"crypto/sha256"
_ "embed"
"encoding/hex"
"errors"
"fmt"
@ -35,6 +36,9 @@ import (
versionCmd "github.com/rclone/rclone/cmd/version"
)
//go:embed selfupdate.md
var selfUpdateHelp string
// Options contains options for the self-update command
type Options struct {
Check bool
@ -63,7 +67,7 @@ var cmdSelfUpdate = &cobra.Command{
Use: "selfupdate",
Aliases: []string{"self-update"},
Short: `Update the rclone binary.`,
Long: strings.ReplaceAll(selfUpdateHelp, "|", "`"),
Long: selfUpdateHelp,
Annotations: map[string]string{
"versionIntroduced": "v1.55",
},