I have written a script, and I need the tab autocomplete in my shell to only select files of a certain type (mp4, mkv, avi), just like rmdir's autocomplete only selects directories. Here's my (inelegant) script:
#!/bin/bash
[ -z "$1" ] && return
command mpv "$1" || exit
fd -q donefile && exit...