Corrections diverses

This commit is contained in:
Benjamin VAUDOUR 2021-09-01 15:55:25 +02:00
parent f8a35a9da3
commit 4170890f54
3 changed files with 9 additions and 8 deletions

View File

@ -4,7 +4,7 @@ edit:add-var curl~ $e:curlie~
edit:add-var df~ $e:duf~ edit:add-var df~ $e:duf~
edit:add-var diff~ $e:colordiff~ edit:add-var diff~ $e:colordiff~
edit:add-var dig~ [@argv]{ e:dig +noall +answer $@argv } edit:add-var dig~ [@argv]{ e:dig +noall +answer $@argv }
edit:add-var dogall~ [@argv]{ e:dog A AAAA CNAME $@argv } edit:add-var dogall~ [@argv]{ e:dog A AAAA CNAME PTR TXT MX SRV NS SOA $@argv }
edit:add-var du~ [@argv]{ e:du -h $@argv } edit:add-var du~ [@argv]{ e:du -h $@argv }
edit:add-var git~ $e:hub~ edit:add-var git~ $e:hub~
edit:add-var grep~ [@argv]{ e:grep --color=tty -d skip $@argv } edit:add-var grep~ [@argv]{ e:grep --color=tty -d skip $@argv }

View File

@ -26,21 +26,21 @@ edit:add-var ipof~ [@argv]{
&txt='' &txt=''
] ]
e:dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml -resolve (idn -a $d) | peach [l]{ e:dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml -resolve (idn -a $d) | peach [l]{
var l = $l var ll = $l
var idx = (+ (str:index $l :) 1) var idx = (+ (str:index $ll :) 1)
var value = (str:trim-space $l[$idx".."]) var value = (str:trim-space $ll[$idx".."])
if (or (str:has-prefix $l 'IPv4 addresses') (str:has-prefix $l 'IPv6 addresses')) { if (or (str:has-prefix $ll 'IPv4 addresses') (str:has-prefix $ll 'IPv6 addresses')) {
str:split ', ' $value | peach [e]{ str:split ', ' $value | peach [e]{
var ee = $e var ee = $e
if (ip:is-ip $ee) { if (ip:is-ip $ee) {
result[ips][$ee] = $nil result[ips][$ee] = $nil
} }
} }
} elif (str:has-prefix $l 'TXT records') { } elif (str:has-prefix $ll 'TXT records') {
result[txt] = $value result[txt] = $value
} elif (str:has-prefix $l 'Resolver') { } elif (str:has-prefix $ll 'Resolver') {
result[resolvers] = $value result[resolvers] = $value
} elif (str:has-prefix $l 'Name servers') { } elif (str:has-prefix $ll 'Name servers') {
result[remote] = (not-eq $value 'name does not exist') result[remote] = (not-eq $value 'name does not exist')
} }
} }

1
rc.elv
View File

@ -1,3 +1,4 @@
#set-env BAT_THEME Coldark-Cold
set-env BAT_PAGER 'less -RF' set-env BAT_PAGER 'less -RF'
set-env EDITOR vim set-env EDITOR vim
set-env VIEW 'vim -R' set-env VIEW 'vim -R'