mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-05 16:37:20 -04:00
lexers for ifconfig and ip
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
filetype: ifconfig
|
||||||
|
|
||||||
|
detect:
|
||||||
|
filename: "\\.ifconfig$"
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# IPv4
|
||||||
|
- green: "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
|
||||||
|
# ipv6
|
||||||
|
- green: "\\b[0-9a-fA-F]{1,4}(\\:\\:?[0-9a-fA-F]{1,4})+"
|
||||||
|
# hwaddr
|
||||||
|
- yellow: "(\\d|[a-f]){2}(\\:(\\d|[a-f]){2}){5}"
|
||||||
|
# size
|
||||||
|
- yellow: "\\d+(\\.\\d+)?\\s(T|G|M|K|)i?B"
|
||||||
|
# interface
|
||||||
|
- cyan: "^([a-z0-9.]{2,}\\d*):?\\s"
|
||||||
|
#ip disc
|
||||||
|
- cyan: "(inet6?|netmask|broadcast)"
|
||||||
|
# mtu
|
||||||
|
- green: "(?i)mtu(\\s|\\:)\\d+"
|
||||||
|
#errors
|
||||||
|
- red: "errors(\\s|\\:)\\d+"
|
||||||
|
- red: "collisions(\\s|\\:)\\d+"
|
||||||
|
- yellow: "flags=(-?\\d+<[A-Z,]+>)"
|
||||||
|
- white: "dropped(\\s|\\:)\\d+"
|
||||||
|
- magenta: "overruns(\\s|\\:)\\d+"
|
||||||
|
- white: "frame(\\s|\\:)\\d+"
|
||||||
|
- cyan: "carrier(\\s|\\:)\\d+"
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
filetype: ip
|
||||||
|
|
||||||
|
detect:
|
||||||
|
filename: "\\.ip$"
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# device
|
||||||
|
- high.green: "\\d+:\\s*[a-z-0-9_]+"
|
||||||
|
- high.green: "state UP"
|
||||||
|
- red: "state DOWN"
|
||||||
|
# IPv4
|
||||||
|
- green: "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
|
||||||
|
# ipv6
|
||||||
|
- green: "\\b[0-9a-fA-F]{1,4}(\\:\\:?[0-9a-fA-F]{1,4})+"
|
||||||
|
# size
|
||||||
|
- yellow: "\\d+(\\.\\d+)?\\s(T|G|M|K|)i?B"
|
||||||
|
# interface
|
||||||
|
- cyan: "^([a-z0-9.]{2,}\\d*):?\\s"
|
||||||
|
#ip disc
|
||||||
|
- cyan: "(inet6?|netmask|broadcast)"
|
||||||
|
# mtu
|
||||||
|
- green: "(?i)mtu(\\s|\\:)\\d+"
|
||||||
|
- green: "src \\S+"
|
||||||
|
#errors
|
||||||
|
- red: "errors(\\s|\\:)\\d+"
|
||||||
|
- red: "collisions(\\s|\\:)\\d+"
|
||||||
|
- red: "linkdown"
|
||||||
|
- yellow: "(<[A-Z,_]+>)"
|
||||||
|
- white: "dropped(\\s|\\:)\\d+"
|
||||||
|
- magenta: "overruns(\\s|\\:)\\d+"
|
||||||
|
- white: "frame(\\s|\\:)\\d+"
|
||||||
|
- cyan: "carrier(\\s|\\:)\\d+"
|
||||||
|
# MAC
|
||||||
|
- yellow: "(\\d|[a-f]){2}(\\:(\\d|[a-f]){2}){5}"
|
||||||
|
- magenta: "link/([a-z]+)"
|
||||||
Reference in New Issue
Block a user