mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-22 16:20:23 +02:00
Initial revision
This commit is contained in:
parent
4a198fed6e
commit
c4b0e2f297
3 changed files with 560 additions and 0 deletions
34
Functions/Misc/nslookup
Normal file
34
Functions/Misc/nslookup
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Simple wrapper function for `nslookup'. With completion if you are using
|
||||
# the function based completion system.
|
||||
|
||||
setopt localoptions completealiases
|
||||
|
||||
local char line compcontext=nslookup pid
|
||||
|
||||
trap 'print -p exit;return' INT
|
||||
|
||||
coproc command nslookup
|
||||
pid=$!
|
||||
|
||||
while read -pk1 char; do
|
||||
line="$line$char"
|
||||
[[ "$line" = *'
|
||||
> ' ]] && break
|
||||
done
|
||||
print -nr - "$line"
|
||||
|
||||
line=''
|
||||
while vared -p '> ' line; do
|
||||
print -p "$line"
|
||||
line=''
|
||||
while read -pk1 char; do
|
||||
line="$line$char"
|
||||
[[ "$line" = *'
|
||||
> ' ]] && break
|
||||
done
|
||||
print -nr - "$line"
|
||||
line=''
|
||||
done
|
||||
|
||||
print -p exit
|
||||
wait $pid
|
Loading…
Add table
Add a link
Reference in a new issue