@@ -67,14 +67,14 @@ class ArgparseUsageLexer(RegexLexer):
6767 (r"\.\.\." , Punctuation ),
6868 # Long options with = value (e.g., --log-level=VALUE)
6969 (
70- r"(--[a-zA-Z0-9][-a-zA-Z0-9]*)(=)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9 ]*)" ,
70+ r"(--[a-zA-Z0-9][-a-zA-Z0-9]*)(=)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9_ ]*)" ,
7171 bygroups (Name .Tag , Operator , Name .Variable ), # type: ignore[no-untyped-call]
7272 ),
7373 # Long options standalone
7474 (r"--[a-zA-Z0-9][-a-zA-Z0-9]*" , Name .Tag ),
7575 # Short options with space-separated value (e.g., -S socket-path)
7676 (
77- r"(-[a-zA-Z0-9])(\s+)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9 ]*)" ,
77+ r"(-[a-zA-Z0-9])(\s+)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9_ ]*)" ,
7878 bygroups (Name .Attribute , Whitespace , Name .Variable ), # type: ignore[no-untyped-call]
7979 ),
8080 # Short options standalone
@@ -94,7 +94,7 @@ class ArgparseUsageLexer(RegexLexer):
9494 # UPPERCASE meta-variables (COMMAND, FILE, PATH)
9595 (r"\b[A-Z][A-Z0-9_]*\b" , Name .Variable ),
9696 # Subcommand/positional names (Name.Function for distinct styling)
97- (r"\b[a-z][-a-z0-9 ]*\b" , Name .Function ),
97+ (r"\b[a-z][-a-z0-9_ ]*\b" , Name .Function ),
9898 # Catch-all for any other text
9999 (r"[^\s\[\]|(){},]+" , Text ),
100100 ],
@@ -105,14 +105,14 @@ class ArgparseUsageLexer(RegexLexer):
105105 (r"\.\.\." , Punctuation ),
106106 # Long options with = value (e.g., --log-level=VALUE)
107107 (
108- r"(--[a-zA-Z0-9][-a-zA-Z0-9]*)(=)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9 ]*)" ,
108+ r"(--[a-zA-Z0-9][-a-zA-Z0-9]*)(=)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9_ ]*)" ,
109109 bygroups (Name .Tag , Operator , Name .Variable ), # type: ignore[no-untyped-call]
110110 ),
111111 # Long options standalone
112112 (r"--[a-zA-Z0-9][-a-zA-Z0-9]*" , Name .Tag ),
113113 # Short options with space-separated value (e.g., -S socket-path)
114114 (
115- r"(-[a-zA-Z0-9])(\s+)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9 ]*)" ,
115+ r"(-[a-zA-Z0-9])(\s+)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9_ ]*)" ,
116116 bygroups (Name .Attribute , Whitespace , Name .Variable ), # type: ignore[no-untyped-call]
117117 ),
118118 # Short options standalone
@@ -132,7 +132,7 @@ class ArgparseUsageLexer(RegexLexer):
132132 # UPPERCASE meta-variables (COMMAND, FILE, PATH)
133133 (r"\b[A-Z][A-Z0-9_]*\b" , Name .Variable ),
134134 # Positional/command names (lowercase with dashes)
135- (r"\b[a-z][-a-z0-9 ]*\b" , Name .Label ),
135+ (r"\b[a-z][-a-z0-9_ ]*\b" , Name .Label ),
136136 # Catch-all for any other text
137137 (r"[^\s\[\]|(){},]+" , Text ),
138138 ],
@@ -234,14 +234,14 @@ class ArgparseHelpLexer(RegexLexer):
234234 (r"\.\.\." , Punctuation ),
235235 # Long options with = value
236236 (
237- r"(--[a-zA-Z0-9][-a-zA-Z0-9]*)(=)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9 ]*)" ,
237+ r"(--[a-zA-Z0-9][-a-zA-Z0-9]*)(=)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9_ ]*)" ,
238238 bygroups (Name .Tag , Operator , Name .Variable ), # type: ignore[no-untyped-call]
239239 ),
240240 # Long options standalone
241241 (r"--[a-zA-Z0-9][-a-zA-Z0-9]*" , Name .Tag ),
242242 # Short options with value
243243 (
244- r"(-[a-zA-Z0-9])(\s+)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9 ]*)" ,
244+ r"(-[a-zA-Z0-9])(\s+)([A-Z][A-Z0-9_]*|[a-z][-a-z0-9_ ]*)" ,
245245 bygroups (Name .Attribute , Whitespace , Name .Variable ), # type: ignore[no-untyped-call]
246246 ),
247247 # Short options standalone
@@ -259,7 +259,7 @@ class ArgparseHelpLexer(RegexLexer):
259259 # UPPERCASE metavars
260260 (r"\b[A-Z][A-Z0-9_]*\b" , Name .Variable ),
261261 # Subcommand/positional names (Name.Function for distinct styling)
262- (r"\b[a-z][-a-z0-9 ]*\b" , Name .Function ),
262+ (r"\b[a-z][-a-z0-9_ ]*\b" , Name .Function ),
263263 # Other text
264264 (r"[^\s\[\]|(){},\n]+" , Text ),
265265 ],
0 commit comments