convmv: fix spurious "error running command echo" on Windows

Before this change the help for convmv was generated by running the
examples each time rclone started up. Unfortunately this involved
running the echo command which did not work on Windows.

This pre-generates the help into `transform.md` and embeds it. It can
be re-generated with `go generate` which is a better solution.

See: https://forum.rclone.org/t/invoke-of-1-70-0-complains-of-echo-not-found/51618
This commit is contained in:
Nick Craig-Wood
2025-06-18 13:51:44 +01:00
parent b064cc2116
commit 4280ec75cc
6 changed files with 276 additions and 21 deletions

View File

@ -11,9 +11,9 @@ import (
)
type transform struct {
key transformAlgo // for example, "prefix"
value string // for example, "some_prefix_"
tag tag // file, dir, or all
key Algo // for example, "prefix"
value string // for example, "some_prefix_"
tag tag // file, dir, or all
}
// tag controls which part of the file path is affected (file, dir, all)
@ -171,12 +171,12 @@ func (t *transform) requiresValue() bool {
return false
}
// transformAlgo describes conversion setting
type transformAlgo = fs.Enum[transformChoices]
// Algo describes conversion setting
type Algo = fs.Enum[transformChoices]
// Supported transform options
const (
ConvNone transformAlgo = iota
ConvNone Algo = iota
ConvToNFC
ConvToNFD
ConvToNFKC