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

@ -3,6 +3,7 @@ package mountlib
import (
"context"
_ "embed"
"fmt"
"log"
"os"
@ -27,6 +28,9 @@ import (
"github.com/spf13/pflag"
)
//go:embed mount.md
var mountHelp string
// Options for creating the mount
type Options struct {
DebugFUSE bool
@ -158,7 +162,7 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
Use: commandName + " remote:path /path/to/mountpoint",
Hidden: hidden,
Short: `Mount the remote as file system on a mountpoint.`,
Long: strings.ReplaceAll(strings.ReplaceAll(mountHelp, "|", "`"), "@", commandName) + vfs.Help,
Long: strings.ReplaceAll(mountHelp, "@", commandName) + vfs.Help,
Annotations: map[string]string{
"versionIntroduced": "v1.33",
"groups": "Filter",