completions/xdg-mime: fix off-by-one error and allow multiple filetypes

This commit is contained in:
Johannes Altmanninger 2024-02-15 09:56:09 +01:00
parent 2915c525fa
commit 26ea024e74

View file

@ -15,8 +15,8 @@ complete -c xdg-mime -d 'Query default application for type' -n 'contains_seq qu
complete -c xdg-mime -d 'Query file\'s filetype' -n 'contains_seq query filetype -- (commandline -cxp)' -r
# complete xdg-mime default
complete -c xdg-mime -d 'Choose application' -n '__fish_seen_subcommand_from default; and __fish_is_nth_token 3' -xa '(__fish_print_xdg_desktop_file_ids)'
complete -c xdg-mime -d Mimetype -n '__fish_seen_subcommand_from default; and __fish_is_nth_token 4' -xa '(__fish_print_xdg_mimetypes)'
complete -c xdg-mime -d 'Choose application' -n '__fish_seen_subcommand_from default; and test (commandline -xpc|count) -eq 2' -xa '(__fish_print_xdg_desktop_file_ids)'
complete -c xdg-mime -d Mimetype -n '__fish_seen_subcommand_from default; and test (commandline -xpc|count) -ge 3' -xa '(__fish_print_xdg_mimetypes)'
# complete xdg-mime install
complete -c xdg-mime -d 'Add filetype description' -n 'contains_seq xdg-mime install -- (commandline -cxp)' -r