change show test utility function

Due to how various tests show the status of variables I decided to
modify the `show` test utility function I recently added.
This commit is contained in:
Kurtis Rader
2017-07-19 22:20:28 -07:00
parent 8f548962b7
commit dc33c1afe1
5 changed files with 18 additions and 25 deletions

View File

@@ -1,4 +1,14 @@
function show
echo count=(count $argv)
printf '|%s|\n' $argv
# 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