From 90b01fd915a39a75d90372480450102164c3a3f0 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 1 Jun 2020 15:51:10 +0200 Subject: [PATCH] set: Show pathvariableness in --show --- src/builtin_set.cpp | 5 +++-- tests/checks/set.fish | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 3d5c2be18..43e900a1f 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -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) { diff --git a/tests/checks/set.fish b/tests/checks/set.fish index 5c1096d1e..564e15032 100644 --- a/tests/checks/set.fish +++ b/tests/checks/set.fish @@ -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