Skip to main content

NegativeOptionHighlighter

This class provides regex-based highlighting for command-line style negative options and switches. It identifies and styles short-form switches and long-form options that begin with a hyphen, ensuring they are correctly recognized as distinct tokens within a text stream.

Attributes

AttributeTypeDescription
highlightslist[str] = ['(^\W)(?P< negative_switch >\-\w+)(?![a-zA-Z0-9])', '(^

Constructor

Signature

def NegativeOptionHighlighter()

Methods


highlights()

def highlights() - > list

Defines the list of regular expression patterns used to identify and style negative command-line switches and options.

Returns

TypeDescription
listA list of raw string regex patterns containing named capture groups for negative switches and options.