Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete --condition given multiple times should complicate predicate #8536

Closed
floam opened this issue Dec 8, 2021 · 2 comments
Closed

complete --condition given multiple times should complicate predicate #8536

floam opened this issue Dec 8, 2021 · 2 comments

Comments

@floam
Copy link
Member

floam commented Dec 8, 2021

So, it seems like currently this is basically strange undefined behavior:

$ complete foo -n false -n true -x -a bar
$ complete -C'foo '
bar
$ complete --erase foo
$ complete foo -n true -n false -x -a bar
$ complete -C'foo '
<file completions>

I propose this should have been equivalent to: complete foo -n "false; and true" ….

@krobelus
Copy link
Member

krobelus commented Dec 8, 2021

Yeah, that sounds better. Looks like we ignore all but the last -n

@floam floam added this to the fish-future milestone Dec 8, 2021
@floam
Copy link
Member Author

floam commented Dec 8, 2021

There might be an argument it could be equivalent to or, but a quick grep suggests and is more useful:

~/s/f/s/completions (master|💩2…) $ grep -r ' -n .* and .*-d' | count
398
~/s/f/s/completions (master|💩2…) $ grep -r ' -n .* or .*-d' | count
36

(It also seems logically intuitive to me that more conditions behave that way.)

@floam floam changed the title complete --condition: argument given multiple times should complicate predicate complete --condition given multiple times should complicate predicate Dec 9, 2021
@faho faho closed this as completed May 30, 2022
@faho faho modified the milestones: fish-future, fish 3.5.0 May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants