diff options
| author | Tanaka Akira <akr@users.sourceforge.net> | 1999-09-06 09:16:29 +0000 |
|---|---|---|
| committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-09-06 09:16:29 +0000 |
| commit | c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0 (patch) | |
| tree | 7643aaea62712b30914331a12de66f23f8ae1719 /Functions | |
| parent | Initial revision (diff) | |
| download | zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.tar zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.tar.gz zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.tar.bz2 zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.tar.lz zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.tar.xz zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.tar.zst zsh-c4b0e2f297a695c32d7ddc1b0b18f656591bd2e0.zip | |
Initial revision
Diffstat (limited to 'Functions')
| -rw-r--r-- | Functions/Misc/nslookup | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Functions/Misc/nslookup b/Functions/Misc/nslookup new file mode 100644 index 000000000..15afb2ff1 --- /dev/null +++ b/Functions/Misc/nslookup @@ -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 |
