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:
Nick Craig-Wood
2020-04-28 12:58:34 +01:00
parent 195d152785
commit 1aa1a2c174
5 changed files with 242 additions and 3 deletions

View File

@ -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: