From 530658e0ccab89e68b15bbf2bc27679b33d4a82a Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 13 Jan 2025 18:35:27 +0000 Subject: [PATCH] doc: make man page well formed for whatis - fixes #7430 --- bin/make_manual.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/make_manual.py b/bin/make_manual.py index d2e756457..2d0fd580e 100755 --- a/bin/make_manual.py +++ b/bin/make_manual.py @@ -7,6 +7,7 @@ conversion into man pages etc. import os import re import time +import subprocess from datetime import datetime docpath = "docs/content" @@ -192,13 +193,23 @@ def main(): command_docs = read_commands(docpath).replace("\\", "\\\\") # escape \ so we can use command_docs in re.sub build_date = datetime.utcfromtimestamp( int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) + help_output = subprocess.check_output(["rclone", "help"]).decode("utf-8") with open(outfile, "w") as out: out.write("""\ %% rclone(1) User Manual %% Nick Craig-Wood %% %s -""" % build_date.strftime("%b %d, %Y")) +# NAME + +rclone - manage files on cloud storage + +# SYNOPSIS + +``` +%s +``` +""" % (build_date.strftime("%b %d, %Y"), help_output)) for doc in docs: contents = read_doc(doc) # Substitute the commands into doc.md