set: Show pathvariableness in --show

This commit is contained in:
Fabian Homborg 2020-06-01 15:51:10 +02:00
parent 4eb906c8d8
commit 90b01fd915
2 changed files with 8 additions and 2 deletions

View file

@ -579,9 +579,10 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams
}
const wchar_t *exportv = var->exports() ? _(L"exported") : _(L"unexported");
const wchar_t *pathvarv = var->is_pathvar() ? _(L" a path variable") : L"";
wcstring_list_t vals = var->as_list();
streams.out.append_format(_(L"$%ls: set in %ls scope, %ls, with %d elements\n"), var_name,
scope_name, exportv, vals.size());
streams.out.append_format(_(L"$%ls: set in %ls scope, %ls,%ls with %d elements\n"), var_name,
scope_name, exportv, pathvarv, vals.size());
for (size_t i = 0; i < vals.size(); i++) {
if (vals.size() > 100) {

View file

@ -635,4 +635,9 @@ set -ql history
echo $status
#CHECK: 1
set --path newvariable foo
set -S newvariable
#CHECK: $newvariable: set in global scope, unexported, a path variable with 1 elements
#CHECK: $newvariable[1]: |foo|
true