You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/bash_completion/generator.py
+65-5Lines changed: 65 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,14 @@
3
3
fromcollectionsimportdefaultdict
4
4
importre
5
5
importsubprocess
6
+
importpystache
7
+
importpprint
6
8
7
-
commandRegex=r"^\s+(?P<command>\w+)\s+(?P<helptxt>[a-zA-Z ]*)$"# This one extracts single commands and the help txt
9
+
commandRegex=r"^\s+(?P<command>(--)?\w+)\s+(?P<helptxt>[a-zA-Z ]*)$"# This one extracts single commands and the help txt
8
10
# Why the hell do spaces get regexed in command1 ?
9
-
subcommandRegex=r"^\s+(?P<command1>-+[a-zA-Z_\-]+(?P<modifier1>\s+[A-Z_\-]+){0,1})(?P<command2>,\s+-+[a-zA-Z_-]+(?P<modifier2>\s+[A-Z_-]+){0,1}){0,1}\s+(?P<helptxt>.*)$"# Gets just about everything
11
+
subcommandRegex=r"^\s+(?P<command1>-+[a-zA-Z_\-]+(?P<modifier1>\s+[A-Z_\-]+)?)(?P<command2>,\s+-+[a-zA-Z_-]+(?P<modifier2>\s+[A-Z_-]+)?)?\s+(?P<helptxt>.*)$"# Gets just about everything
0 commit comments