mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
Allow set --query to check for pathvarness (#8494)
Currently,
set -q --unpath PATH
simply ignores the "--unpath" bit (and same for "--path").
This changes it, so just like exportedness you can check pathness.
This commit is contained in:
@@ -415,10 +415,30 @@ set --unpath __fish_test_PATH $__fish_test_PATH
|
||||
echo "$__fish_test_path_not $__fish_test_PATH" $__fish_test_path_not $__fish_test_PATH
|
||||
# CHECK: a b c 1 2 3 a b c 1 2 3
|
||||
|
||||
set -q --path __fish_test_PATH
|
||||
and echo __fish_test_PATH is a pathvar
|
||||
or echo __fish_test_PATH is not a pathvar
|
||||
# CHECK: __fish_test_PATH is not a pathvar
|
||||
|
||||
set -q --unpath __fish_test_PATH
|
||||
and echo __fish_test_PATH is not a pathvar
|
||||
or echo __fish_test_PATH is not not a pathvar
|
||||
# CHECK: __fish_test_PATH is not a pathvar
|
||||
|
||||
set --path __fish_test_path_not $__fish_test_path_not
|
||||
echo "$__fish_test_path_not $__fish_test_PATH" $__fish_test_path_not $__fish_test_PATH
|
||||
# CHECK: a:b:c 1 2 3 a b c 1 2 3
|
||||
|
||||
set -q --path __fish_test_path_not
|
||||
and echo __fish_test_path_not is a pathvar
|
||||
or echo __fish_test_path_not is not a pathvar
|
||||
# CHECK: __fish_test_path_not is a pathvar
|
||||
|
||||
set -q --unpath __fish_test_path_not
|
||||
and echo __fish_test_path_not is not a pathvar
|
||||
or echo __fish_test_path_not is not not a pathvar
|
||||
# CHECK: __fish_test_path_not is not not a pathvar
|
||||
|
||||
set --path __fish_test_PATH $__fish_test_PATH
|
||||
echo "$__fish_test_path_not $__fish_test_PATH" $__fish_test_path_not $__fish_test_PATH
|
||||
# CHECK: a:b:c 1:2:3 a b c 1 2 3
|
||||
|
||||
Reference in New Issue
Block a user