The documentation is incorrect due to a copy/paste mistake. I am the person who implemented "set -show". It is a debug tool. It is not meant to be used in the same way "set -q" is meant to be used. Restricting the scope would defeat the purpose of "set --show" as the intent is to help people understand why, for example, the uvar value isn't being used because it has been shadowed by a global or local scope.
On Wed, Jul 3, 2019 at 12:45 PM Lee Walsh <leeawa...@gmail.com> wrote: > The usage signature for set --show suggests that scope options are > available: > > set ( -S | --show ) [SCOPE_OPTIONS] [VARIABLE_NAME]... > > However, it seems that anything in SCOPE_OPTIONS is rejected: > > ~> set myvarname my var vals > > ~> set --show myvarname > $myvarname: not set in local scope > $myvarname: set in global scope, unexported, with 3 elements > $myvarname[1]: length=2 value=|my| > $myvarname[2]: length=3 value=|var| > $myvarname[3]: length=4 value=|vals| > $myvarname: not set in universal scope > > ~> set --show --global myvarname > set: Invalid combination of options > set: Type 'help set' for related documentation > > ~> fish --version > fish, version 3.0.2 > > My expected (and preferred) behavior would restrict the output information > to the scope (and export status), for example: > > ~> set --show --local myvarname > $myvarname: not set in local scope > > ~> set --show --global myvarname > $myvarname: set in global scope, unexported, with 3 elements > $myvarname[1]: length=2 value=|my| > $myvarname[2]: length=3 value=|var| > $myvarname[3]: length=4 value=|vals| > > This would parallel set --query: > > ~> set --query myvarname; echo $status > 0 > ~> set --query --local myvarname; echo $status > 1 > ~> set --query --global myvarname; echo $status > 0 > > Any thoughts on the intended behavior? To my interpretation, either the > behavior or the documentation is incorrect. > > Lee Walsh > _______________________________________________ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank
_______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users