|
| 1 | +$myName = ($MyInvocation.MyCommand.ScriptBlock.File | Split-Path -Leaf) -replace '\.source', '' -replace '\.ps1', '.txt' |
| 2 | +$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path |
| 3 | + |
| 4 | +New-RegEx -Description "Matches an ANSI cursor control" | |
| 5 | + New-RegEx -CharacterClass Escape | |
| 6 | + New-RegEx -LiteralCharacter '[' | |
| 7 | + New-RegEx -Atomic -Or @( |
| 8 | + New-RegEx -Pattern '6n' -Name 'DeviceStatusReport' -Comment '6n will request the cursor position' |
| 9 | + New-RegEx -Pattern ( |
| 10 | + New-RegEx -Name Row -Pattern '\d+' | |
| 11 | + New-RegEx -LiteralCharacter ';' | |
| 12 | + New-RegEx -Name Column -Pattern '\d+' | |
| 13 | + New-RegEx -Pattern 'R' |
| 14 | + ) -Comment "A Device Status Report will return CursorPosition in the form <row>;<column> R" -Name CursorPosition |
| 15 | + New-RegEx -Name CursorUp -Comment "Cursor Up is a digit followed by A" -Pattern ( |
| 16 | + New-RegEx -Name RowCount -Pattern '\d+' | |
| 17 | + New-RegEx -Pattern 'A' |
| 18 | + ) |
| 19 | + New-RegEx -Name CursorDown -Comment "Cursor Down is a digit followed by B" -Pattern ( |
| 20 | + New-RegEx -Name RowCount -Pattern '\d+' | |
| 21 | + New-RegEx -Pattern 'B' |
| 22 | + ) |
| 23 | + New-RegEx -Name CursorForward -Comment "Cursor Forward is a digit followed by C" -Pattern ( |
| 24 | + New-RegEx -Name ColumnCount -Pattern '\d+' | |
| 25 | + New-RegEx -Pattern 'C' |
| 26 | + ) |
| 27 | + New-RegEx -Name CursorBack -Comment "Cursor Back is a digit followed by D" -Pattern ( |
| 28 | + New-RegEx -Name ColumnCount -Pattern '\d+' | |
| 29 | + New-RegEx -Pattern 'D' |
| 30 | + ) |
| 31 | + New-RegEx -Name CursorNextLine -Comment "Cursor Next Line is a digit followed by E" -Pattern ( |
| 32 | + New-RegEx -Name LineCount -Pattern '\d+' | |
| 33 | + New-RegEx -Pattern 'E' |
| 34 | + ) |
| 35 | + New-RegEx -Name CursorNextLine -Comment "Cursor Next Line is a digit followed by F" -Pattern ( |
| 36 | + New-RegEx -Name LineCount -Pattern '\d+' | |
| 37 | + New-RegEx -Pattern 'F' |
| 38 | + ) |
| 39 | + New-RegEx -Name CursorAbsolute -Comment "Cursor Absolute Position is a digit followed by G" -Pattern ( |
| 40 | + New-RegEx -Name AbsolutePosition -Pattern '\d+' | |
| 41 | + New-RegEx -Pattern 'G' |
| 42 | + ) |
| 43 | + New-RegEx -Name CursorPosition -Comment "Cursor Positions are two optional digits, separated by semicolon, ending with H" -Pattern ( |
| 44 | + New-RegEx -Name Row -Pattern '\d{0,}' | |
| 45 | + New-RegEx -LiteralCharacter ';' | |
| 46 | + New-RegEx -Name Column -Pattern '\d{0,}' | |
| 47 | + New-RegEx -LiteralCharacter 'H' |
| 48 | + ) |
| 49 | + New-RegEx -Name ScrollUp -Comment "Scroll Up is a digit followed by S" -Pattern ( |
| 50 | + New-RegEx -Name PageCount -Pattern '\d+' | |
| 51 | + New-RegEx -Pattern 'S' |
| 52 | + ) |
| 53 | + New-RegEx -Name ScrollDown -Comment "Scroll Down is a digit followed by T" -Pattern ( |
| 54 | + New-RegEx -Name PageCount -Pattern '\d+' | |
| 55 | + New-RegEx -Pattern 'T' |
| 56 | + ) |
| 57 | + New-RegEx -Name CursorHide -Comment 'Cursors can be hidden with 25h' ( |
| 58 | + New-RegEx -Pattern '25h' |
| 59 | + ) |
| 60 | + New-RegEx -Name CursorShow -Comment 'Cursors can be hidden with 25l' ( |
| 61 | + New-RegEx -Pattern '25l' |
| 62 | + ) |
| 63 | + ) | |
| 64 | + Set-Content -Path (Join-Path $myRoot $myName) -PassThru |
0 commit comments