Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
singlestore-labs
GitHub Repository: singlestore-labs/singlestoredb-python
Path: blob/main/resources/gen_fusion_handlers_doc.py
469 views
1
#!/usr/bin/env python3
2
# type: ignore
3
from __future__ import annotations
4
5
import os
6
from optparse import OptionParser
7
8
from singlestoredb.fusion.registry import _handlers
9
10
parser = OptionParser()
11
parser.add_option(
12
'-d', '--dir',
13
default='_gen_fusion_help',
14
help='output directory',
15
)
16
17
(options, args) = parser.parse_args()
18
19
os.makedirs(options.dir, exist_ok=True)
20
21
for k, v in _handlers.items():
22
out_filename = os.path.join(options.dir, k.replace(' ', '_').lower()) + '.md'
23
with open(out_filename, 'w') as f:
24
f.write(v.help)
25
26