refactor: improve partials script
This commit is contained in:
@@ -2,7 +2,8 @@ import subprocess # noqa: S404, RUF100
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
subcommands = [
|
||||
def extract_command_partials():
|
||||
subcommands = [
|
||||
"trade",
|
||||
"create-userdir",
|
||||
"new-config",
|
||||
@@ -37,24 +38,26 @@ subcommands = [
|
||||
"strategy-updater",
|
||||
"lookahead-analysis",
|
||||
"recursive-analysis",
|
||||
]
|
||||
]
|
||||
|
||||
result = subprocess.run(["freqtrade", "--help"], capture_output=True, text=True)
|
||||
result = subprocess.run(["freqtrade", "--help"], capture_output=True, text=True)
|
||||
|
||||
with Path("docs/commands/main.md").open("w") as f:
|
||||
with Path("docs/commands/main.md").open("w") as f:
|
||||
f.write(f"```\n{result.stdout}\n```\n")
|
||||
|
||||
|
||||
for command in subcommands:
|
||||
for command in subcommands:
|
||||
print(f"Running for {command}")
|
||||
result = subprocess.run(["freqtrade", command, "--help"], capture_output=True, text=True)
|
||||
|
||||
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)
|
||||
|
||||
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:
|
||||
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