mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-03 16:44:00 +08:00
dc33c1afe1
Due to how various tests show the status of variables I decided to modify the `show` test utility function I recently added.
15 lines
379 B
Fish
15 lines
379 B
Fish
# Show information about the named var(s) passed to us.
|
|
function show --no-scope-shadowing
|
|
for v in $argv
|
|
if set -q $v
|
|
set -l c (count $$v)
|
|
printf '$%s count=%d\n' $v $c
|
|
for i in (seq $c)
|
|
printf '$%s[%d]=|%s|\n' $v $i $$v[1][$i]
|
|
end
|
|
else
|
|
echo \$$v is not set
|
|
end
|
|
end
|
|
end
|