Skip to content

Commit c002c64

Browse files
committed
Add minor help script and comments
1 parent 6bbedb5 commit c002c64

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

check_tools/config-update.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import subprocess
44

55
def split_into_pairs(l):
6-
# looping till length l
76
for i in range(0, len(l), 2):
87
yield l[i:i + 2]
98

@@ -14,6 +13,7 @@ def main(file):
1413

1514
blocks = {}
1615
for i in range(0, int(len(snippet_indices) / 2)):
16+
# Need to rerun on every loop as the indices change each iteration
1717
snippet_indices = [m.start() for m in re.finditer('```', file)]
1818
ranges = list(split_into_pairs(snippet_indices))
1919
start = ranges[i][0]
@@ -47,6 +47,11 @@ def main(file):
4747
else:
4848
path = sys.argv[1]
4949

50+
if (path == '-h' or path == '--help'):
51+
print("By default the script runs out of the docs tools directory and iterates through reference/configuration.\n"
52+
"You may pass in a directory path that will run on all files contained within, or a single file path optionally.")
53+
exit(0)
54+
5055
if (os.path.isfile(path)):
5156
main(path)
5257
else:

0 commit comments

Comments
 (0)