Files
RedBear-OS/recipes/shells/zsh/source/Functions/Misc/nslookup
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

48 lines
1.1 KiB
Plaintext

# Simple wrapper function for `nslookup'. With completion if you are using
# the function based completion system.
if [[ $argv[(I)-] -eq 0 && $argv[(I)[^-]*] -ne 0 ]]; then
command nslookup "$@"
return
fi
setopt localoptions localtraps completealiases
local tmp line compcontext=nslookup curcontext='nslookup:::' pmpt
local pager opager="$PAGER"
typeset +g -x PAGER=cat
zmodload -e zsh/zpty || zmodload -i zsh/zpty
trap 'return 130' INT
trap 'zpty -d nslookup' EXIT
pmpt=()
zstyle -s ':nslookup' prompt tmp && pmpt=(-p "$tmp")
zstyle -s ':nslookup' rprompt tmp && pmpt=("$pmpt[@]" -r "$tmp")
zstyle -s ':nslookup' pager tmp &&
[[ -z "$pager" ]] && pager="${opager:-more}"
(( $#pmpt )) || pmpt=(-p '> ')
zpty nslookup command nslookup "${(q)@}"
zpty -r nslookup line '*> '
print -nr "$line"
while line=''; vared -he "$pmpt[@]" line; do
print -s "$line"
[[ "$line" = exit ]] && break
zpty -w nslookup "$line"
zpty -r nslookup line '(|*
)> '
if [[ -n "$pager" && ${#${(f)line}} -gt LINES ]]; then
print -nr "$line" | eval "$pager"
else
print -nr "$line"
fi
done
zpty -w nslookup 'exit'