mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
completions/mpc: conditionally enable file completion for add and insert
When connecting to MPD via a Unix socket, mpc add and insert accept absolute paths to local files. Offer these in the completion if the completed token starts with a slash after expansion.
This commit is contained in:
committed by
Johannes Altmanninger
parent
5ece9bec6c
commit
67a9d08778
@@ -85,6 +85,7 @@ complete -c mpc -n "not __fish_seen_subcommand_from $subcommands" -a current -d
|
||||
|
||||
# Using '(mpc search filename (commandline -ct))' _might_ be faster for larger libraries
|
||||
complete -c mpc -n "__fish_seen_subcommand_from add insert" -a "(mpc listall)"
|
||||
complete -c mpc -n "__fish_seen_subcommand_from add insert" -n 'string match -qr -- ^/ "$(commandline -xt)"' -F
|
||||
|
||||
complete -c mpc -n "__fish_seen_subcommand_from playlist load" -a "(mpc lsplaylists)"
|
||||
complete -c mpc -n "__fish_seen_subcommand_from consume random repeat single" -a "on off"
|
||||
|
||||
Reference in New Issue
Block a user