mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 14:23:09 +00:00
5eb0b34da1
This will respect the `/usr/local/share/applications/` directory when fetching mime infos. Update xdg-mime helper to comply with the xdg spec. This also makes sure __fish_print_xdg_applications_directories only prints directories that exist. Relevant specs: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://specifications.freedesktop.org/desktop-entry-spec/latest/ape.html
31 lines
1.9 KiB
Fish
31 lines
1.9 KiB
Fish
|
|
# main completion
|
|
complete -c xdg-mime -n 'not __fish_seen_subcommand_from query default install uninstall' -xa 'query default install uninstall'
|
|
|
|
# complete xdg-mime query
|
|
complete -c xdg-mime -n '__fish_seen_subcommand_from query; and not __fish_seen_subcommand_from filetype default' -xa 'filetype default' -d 'Query information'
|
|
|
|
# complete xdg-mime query default
|
|
complete -c xdg-mime -d 'Query default application for type' -n 'contains_seq query default -- (commandline -cop)' -xa '(__fish_print_xdg_mimetypes)'
|
|
|
|
# complete xdg-mime query filetype
|
|
complete -c xdg-mime -d 'Query file\'s filetype' -n 'contains_seq query filetype -- (commandline -cop)' -r
|
|
|
|
# complete xdg-mime default
|
|
complete -c xdg-mime -d 'Choose application' -n '__fish_seen_subcommand_from default; and __fish_is_token_n 3' -xa '(__fish_print_xdg_desktop_file_ids)'
|
|
complete -c xdg-mime -d 'Mimetype' -n '__fish_seen_subcommand_from default; and __fish_is_token_n 4' -xa '(__fish_print_xdg_mimetypes)'
|
|
|
|
# complete xdg-mime install
|
|
complete -c xdg-mime -d 'Add filetype description' -n 'contains_seq xdg-mime install -- (commandline -cop)' -r
|
|
complete -c xdg-mime -d 'Set mode' -n 'contains_seq xdg-mime install -- (commandline -cop)' -l mode -xa 'user system'
|
|
complete -c xdg-mime -d 'Disable vendor check' -n 'contains_seq xdg-mime install -- (commandline -cop)' -l novendor
|
|
|
|
# complete xdg-mime uninstall
|
|
complete -c xdg-mime -d 'Remove filetype description' -n 'contains_seq xdg-mime uninstall -- (commandline -cop)' -r
|
|
complete -c xdg-mime -d 'Set mode' -n 'contains_seq xdg-mime uninstall -- (commandline -cop)' -l mode -xa 'user system'
|
|
|
|
#complete -c xdg-mime install [--mode mode] [--novendor] mimetypes-file
|
|
#complete -c xdg-mime uninstall [--mode mode] mimetypes-file
|
|
complete -c xdg-mime -l help -d 'Display help'
|
|
complete -c xdg-mime -l manual -d 'Diplay long help'
|
|
complete -c xdg-mime -l version -d 'Print version'
|