makefile: fix lib/transform docs not getting updated

As of
4280ec75cc
the lib/transform docs are generated with //go:generate and embedded with
//go:embed.

Before this change, however, they were not getting automatically updated with
subsequent changes (like
fe62a2bb4e)
because `go generate ./lib/transform` was not being run as part of the release
making process.

This change fixes that by running it in `make commanddocs`.
This commit is contained in:
nielash
2025-08-30 00:31:55 -04:00
committed by Nick Craig-Wood
parent 8c37a9c2ef
commit b8a379c9c9
2 changed files with 140 additions and 131 deletions

View File

@@ -145,6 +145,7 @@ MANUAL.txt: MANUAL.md
pandoc -s --from markdown-smart --to plain MANUAL.md -o MANUAL.txt pandoc -s --from markdown-smart --to plain MANUAL.md -o MANUAL.txt
commanddocs: rclone commanddocs: rclone
go generate ./lib/transform
-@rmdir -p '$$HOME/.config/rclone' -@rmdir -p '$$HOME/.config/rclone'
XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" rclone gendocs --config=/notfound docs/content/ XDG_CACHE_HOME="" XDG_CONFIG_HOME="" HOME="\$$HOME" USER="\$$USER" rclone gendocs --config=/notfound docs/content/
@[ ! -e '$$HOME' ] || (echo 'Error: created unwanted directory named $$HOME' && exit 1) @[ ! -e '$$HOME' ] || (echo 'Error: created unwanted directory named $$HOME' && exit 1)

View File

@@ -11,6 +11,9 @@
| `--name-transform replace=old:new` | Replaces occurrences of old with new in the file name. | | `--name-transform replace=old:new` | Replaces occurrences of old with new in the file name. |
| `--name-transform date={YYYYMMDD}` | Appends or prefixes the specified date format. | | `--name-transform date={YYYYMMDD}` | Appends or prefixes the specified date format. |
| `--name-transform truncate=N` | Truncates the file name to a maximum of N characters. | | `--name-transform truncate=N` | Truncates the file name to a maximum of N characters. |
| `--name-transform truncate_keep_extension=N` | Truncates the file name to a maximum of N characters while preserving the original file extension. |
| `--name-transform truncate_bytes=N` | Truncates the file name to a maximum of N bytes (not characters). |
| `--name-transform truncate_bytes_keep_extension=N` | Truncates the file name to a maximum of N bytes (not characters) while preserving the original file extension. |
| `--name-transform base64encode` | Encodes the file name in Base64. | | `--name-transform base64encode` | Encodes the file name in Base64. |
| `--name-transform base64decode` | Decodes a Base64-encoded file name. | | `--name-transform base64decode` | Decodes a Base64-encoded file name. |
| `--name-transform encoder=ENCODING` | Converts the file name to the specified encoding (e.g., ISO-8859-1, Windows-1252, Macintosh). | | `--name-transform encoder=ENCODING` | Converts the file name to the specified encoding (e.g., ISO-8859-1, Windows-1252, Macintosh). |
@@ -25,11 +28,11 @@
| `--name-transform nfd` | Converts the file name to NFD Unicode normalization form. | | `--name-transform nfd` | Converts the file name to NFD Unicode normalization form. |
| `--name-transform nfkc` | Converts the file name to NFKC Unicode normalization form. | | `--name-transform nfkc` | Converts the file name to NFKC Unicode normalization form. |
| `--name-transform nfkd` | Converts the file name to NFKD Unicode normalization form. | | `--name-transform nfkd` | Converts the file name to NFKD Unicode normalization form. |
| `--name-transform command=/path/to/my/programfile names.` | Executes an external program to transform | | `--name-transform command=/path/to/my/programfile names.` | Executes an external program to transform. |
Conversion modes: Conversion modes:
```
```text
none none
nfc nfc
nfd nfd
@@ -44,6 +47,9 @@ trimsuffix
index index
date date
truncate truncate
truncate_keep_extension
truncate_bytes
truncate_bytes_keep_extension
base64encode base64encode
base64decode base64decode
encoder encoder
@@ -60,9 +66,10 @@ url
regex regex
command command
``` ```
Char maps:
```
Char maps:
```text
IBM-Code-Page-037 IBM-Code-Page-037
IBM-Code-Page-437 IBM-Code-Page-437
IBM-Code-Page-850 IBM-Code-Page-850
@@ -106,8 +113,10 @@ Windows-1257
Windows-1258 Windows-1258
X-User-Defined X-User-Defined
``` ```
Encoding masks: Encoding masks:
```
```text
Asterisk Asterisk
BackQuote BackQuote
BackSlash BackSlash
@@ -139,86 +148,85 @@ Asterisk
Slash Slash
SquareBracket SquareBracket
``` ```
Examples: Examples:
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,uppercase" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,uppercase"
// Output: STORIES/THE QUICK BROWN FOX!.TXT // Output: STORIES/THE QUICK BROWN FOX!.TXT
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,replace=Fox:Turtle" --name-transform "all,replace=Quick:Slow" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,replace=Fox:Turtle" --name-transform "all,replace=Quick:Slow"
// Output: stories/The Slow Brown Turtle!.txt // Output: stories/The Slow Brown Turtle!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,base64encode" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,base64encode"
// Output: c3Rvcmllcw==/VGhlIFF1aWNrIEJyb3duIEZveCEudHh0 // Output: c3Rvcmllcw==/VGhlIFF1aWNrIEJyb3duIEZveCEudHh0
``` ```
``` ```sh
rclone convmv "c3Rvcmllcw==/VGhlIFF1aWNrIEJyb3duIEZveCEudHh0" --name-transform "all,base64decode" rclone convmv "c3Rvcmllcw==/VGhlIFF1aWNrIEJyb3duIEZveCEudHh0" --name-transform "all,base64decode"
// Output: stories/The Quick Brown Fox!.txt // Output: stories/The Quick Brown Fox!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,nfc" rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,nfc"
// Output: stories/The Quick Brown 🦊 Fox Went to the Café!.txt // Output: stories/The Quick Brown 🦊 Fox Went to the Café!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,nfd" rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,nfd"
// Output: stories/The Quick Brown 🦊 Fox Went to the Café!.txt // Output: stories/The Quick Brown 🦊 Fox Went to the Café!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown 🦊 Fox!.txt" --name-transform "all,ascii" rclone convmv "stories/The Quick Brown 🦊 Fox!.txt" --name-transform "all,ascii"
// Output: stories/The Quick Brown Fox!.txt // Output: stories/The Quick Brown Fox!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,trimsuffix=.txt" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,trimsuffix=.txt"
// Output: stories/The Quick Brown Fox! // Output: stories/The Quick Brown Fox!
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,prefix=OLD_" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,prefix=OLD_"
// Output: OLD_stories/OLD_The Quick Brown Fox!.txt // Output: OLD_stories/OLD_The Quick Brown Fox!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,charmap=ISO-8859-7" rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,charmap=ISO-8859-7"
// Output: stories/The Quick Brown _ Fox Went to the Caf_!.txt // Output: stories/The Quick Brown _ Fox Went to the Caf_!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox: A Memoir [draft].txt" --name-transform "all,encoder=Colon,SquareBracket" rclone convmv "stories/The Quick Brown Fox: A Memoir [draft].txt" --name-transform "all,encoder=Colon,SquareBracket"
// Output: stories/The Quick Brown Fox A Memoir draft.txt // Output: stories/The Quick Brown Fox A Memoir draft.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,truncate=21" rclone convmv "stories/The Quick Brown 🦊 Fox Went to the Café!.txt" --name-transform "all,truncate=21"
// Output: stories/The Quick Brown 🦊 Fox // Output: stories/The Quick Brown 🦊 Fox
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=echo" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=echo"
// Output: stories/The Quick Brown Fox!.txt // Output: stories/The Quick Brown Fox!.txt
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}" rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
// Output: stories/The Quick Brown Fox!-20250618 // Output: stories/The Quick Brown Fox!-20250830
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}" rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
// Output: stories/The Quick Brown Fox!-2025-06-18 0148PM // Output: stories/The Quick Brown Fox!-2025-08-30 1234AM
``` ```
``` ```sh
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,regex=[\\.\\w]/ab" rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,regex=[\\.\\w]/ab"
// Output: ababababababab/ababab ababababab ababababab ababab!abababab // Output: ababababababab/ababab ababababab ababababab ababab!abababab
``` ```