implement set --show

This adds a new capability to the `set` command. It is similar to
running `set` with no other arguments but provides far more detail about
each variable. Such as whether it is set in each of the local, global,
and universal scopes. And the values in each scope. You can also ask for
specific variables to be shown.

Fixes #4265
This commit is contained in:
Kurtis Rader
2017-08-01 20:58:40 -07:00
parent b4ce749c69
commit e825415917
5 changed files with 155 additions and 14 deletions

15
tests/set.in Normal file
View File

@@ -0,0 +1,15 @@
# Test various behaviors of the `set` command.
logmsg Verify behavior of `set --show` given an invalid var name
set --show 'argle bargle'
echo '# Verify behavior of `set --show`'
set -U var1 hello
set --show var1
set -l var1
set -g var1 goodbye "and don't come back"
set --show var1
set -g var2
set --show _unset_var var2