mirror of
https://github.com/rclone/rclone.git
synced 2025-08-09 05:54:43 +02:00
backend: add new backend command for backend specific commands
These commands are for implementing backend specific functionality. They have documentation which is placed automatically into the backend doc. There is a simple test for the feature in the backend tests.
This commit is contained in:
@ -4,6 +4,7 @@ Make backend documentation
|
||||
"""
|
||||
|
||||
import os
|
||||
import io
|
||||
import subprocess
|
||||
|
||||
marker = "<!--- autogenerated options"
|
||||
@ -19,6 +20,11 @@ def output_docs(backend, out):
|
||||
out.flush()
|
||||
subprocess.check_call(["rclone", "help", "backend", backend], stdout=out)
|
||||
|
||||
def output_backend_tool_docs(backend, out):
|
||||
"""Output documentation for backend tool to out"""
|
||||
out.flush()
|
||||
subprocess.call(["rclone", "backend", "help", backend], stdout=out, stderr=subprocess.DEVNULL)
|
||||
|
||||
def alter_doc(backend):
|
||||
"""Alter the documentation for backend"""
|
||||
doc_file = "docs/content/"+backend+".md"
|
||||
@ -35,6 +41,7 @@ def alter_doc(backend):
|
||||
start_full = start + " - DO NOT EDIT, instead edit fs.RegInfo in backend/%s/%s.go then run make backenddocs -->\n" % (backend, backend)
|
||||
out_file.write(start_full)
|
||||
output_docs(backend, out_file)
|
||||
output_backend_tool_docs(backend, out_file)
|
||||
out_file.write(stop+" -->\n")
|
||||
altered = True
|
||||
if not in_docs:
|
||||
|
Reference in New Issue
Block a user