mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-25 00:21:58 +00:00
suport hex flags in the output of ifconfig; see #979
This commit is contained in:
parent
6279aa57d7
commit
7eb501c0f5
1 changed files with 2 additions and 2 deletions
|
@ -5337,8 +5337,8 @@ function _p9k_prompt_net_iface_async() {
|
|||
typeset -a iface2ip ips ifaces
|
||||
if (( $+commands[ifconfig] )); then
|
||||
for line in ${(f)"$(command ifconfig 2>/dev/null)"}; do
|
||||
if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=(<->)'<'* ]]; then
|
||||
[[ $match[2] == *[13579] ]] && iface=$match[1] || iface=
|
||||
if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=([[:xdigit:]]##)'<'* ]]; then
|
||||
[[ $match[2] == *[13579bdfBDF] ]] && iface=$match[1] || iface=
|
||||
elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then
|
||||
iface2ip+=($iface $match[1])
|
||||
iface=
|
||||
|
|
Loading…
Reference in a new issue