gendocs: refactor and add logging of skipped command docs

This commit is contained in:
albertony
2025-09-02 14:06:31 +02:00
parent 813708c24d
commit fa1d7da272
+11 -10
View File
@@ -170,17 +170,18 @@ rclone.org website.`,
name := filepath.Base(path) name := filepath.Base(path)
cmd, ok := commands[name] cmd, ok := commands[name]
if !ok { if !ok {
switch runtime.GOOS { switch name {
case "darwin": case "rclone_mount.md":
if name == "rclone_mount.md" { switch runtime.GOOS {
return nil // won't exist without -tags cmount case "darwin", "windows":
fs.Logf(nil, "Skipping docs for command not available without the cmount build tag: %v", name)
return nil
} }
case "windows": case "rclone_nfsmount.md", "rclone_serve_nfs.md":
switch name { switch runtime.GOOS {
case "rclone_mount.md": case "windows":
return nil // won't exist without -tags cmount fs.Logf(nil, "Skipping docs for command not supported on %v: %v", runtime.GOOS, name)
case "rclone_nfsmount.md", "rclone_serve_nfs.md": return nil
return nil // not supported
} }
} }
return fmt.Errorf("didn't find command for %q", name) return fmt.Errorf("didn't find command for %q", name)