Skip to content

Conversation

@Dracape
Copy link

@Dracape Dracape commented Sep 29, 2025

Make done.fish compatible with test-require-arg feature

For historical reasons, test supports the one-argument form (test foo), and this will also be triggered by e.g. test -n $foo if $foo is unset. We recommend you don’t use the one-argument form and quote all variables or command substitutions used with test.
This confusing misfeature will be removed in future. test -n without any additional argument will be false, test -z will be true and any other invocation with exactly one or zero arguments, including test -d and test "foo" will be an error.
The same goes for [, e.g. [ "foo" ] and [ -d ] will be errors.
This can be turned on already via the test-require-arg feature flag, and will eventually become the default and then only option.

Fish documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant