completions/bind: don't suggest key names if --function-names is given

This combination makes no sense and should be an error.  (Also the
short options and --key-names were missing, so this was quite
inconsistent.)

See #11864
This commit is contained in:
Johannes Altmanninger
2025-10-05 11:51:50 +02:00
parent 061517cd14
commit e97a616ffa

View File

@@ -60,7 +60,7 @@ complete -c bind -n __fish_bind_test2 -a '(bind --function-names)' -d 'Function
function __fish_bind_complete
argparse M/mode= m/sets-mode= preset user s/silent \
a/all function-names list-modes e/erase -- (commandline -xpc)[2..] 2>/dev/null
a/all e/erase -- (commandline -xpc)[2..] 2>/dev/null
or return 1
set -l token (commandline -ct)
if test (count $argv) = 0 && set -l prefix (string match -r -- '(.*,)?(ctrl-|alt-|shift-|super-)*' $token)