File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 3
3
import subprocess
4
4
5
5
def split_into_pairs (l ):
6
- # looping till length l
7
6
for i in range (0 , len (l ), 2 ):
8
7
yield l [i :i + 2 ]
9
8
@@ -14,6 +13,7 @@ def main(file):
14
13
15
14
blocks = {}
16
15
for i in range (0 , int (len (snippet_indices ) / 2 )):
16
+ # Need to rerun on every loop as the indices change each iteration
17
17
snippet_indices = [m .start () for m in re .finditer ('```' , file )]
18
18
ranges = list (split_into_pairs (snippet_indices ))
19
19
start = ranges [i ][0 ]
@@ -47,6 +47,11 @@ def main(file):
47
47
else :
48
48
path = sys .argv [1 ]
49
49
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
+
50
55
if (os .path .isfile (path )):
51
56
main (path )
52
57
else :
You can’t perform that action at this time.
0 commit comments