refactor: improve partials script
This commit is contained in:
@@ -2,6 +2,7 @@ import subprocess # noqa: S404, RUF100
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def extract_command_partials():
|
||||
subcommands = [
|
||||
"trade",
|
||||
"create-userdir",
|
||||
@@ -44,7 +45,6 @@ result = subprocess.run(["freqtrade", "--help"], capture_output=True, text=True)
|
||||
with Path("docs/commands/main.md").open("w") as f:
|
||||
f.write(f"```\n{result.stdout}\n```\n")
|
||||
|
||||
|
||||
for command in subcommands:
|
||||
print(f"Running for {command}")
|
||||
result = subprocess.run(["freqtrade", command, "--help"], capture_output=True, text=True)
|
||||
@@ -52,9 +52,12 @@ for command in subcommands:
|
||||
with Path(f"docs/commands/{command}.md").open("w") as f:
|
||||
f.write(f"```\n{result.stdout}\n```\n")
|
||||
|
||||
|
||||
print("Running for freqtrade-client")
|
||||
result_client = subprocess.run(["freqtrade-client", "--show"], capture_output=True, text=True)
|
||||
|
||||
with Path("docs/commands/freqtrade-client.md").open("w") as f:
|
||||
f.write(f"```\n{result_client.stdout}\n```\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
extract_command_partials()
|
||||
|
||||
Reference in New Issue
Block a user