__fish_complete_suffix: don't provide file description by default

Drops dependency on the mimedb tool and reflects the changes made to the
default chooser for files in #279.
This commit is contained in:
David Adam 2015-07-23 14:22:27 +08:00
parent f77f71c17e
commit 7fa69ef8be
2 changed files with 6 additions and 5 deletions

View file

@ -362,7 +362,7 @@ Functions beginning with the string `__fish_print_` print a newline separated li
- `__fish_complete_pids` prints a list of all processes IDs with the command name as description. - `__fish_complete_pids` prints a list of all processes IDs with the command name as description.
- `__fish_complete_suffix SUFFIX` performs file completion allowing only files ending in SUFFIX. The mimetype database is used to find a suitable description. - `__fish_complete_suffix SUFFIX` performs file completion allowing only files ending in SUFFIX, with an optional description.
- `__fish_complete_users` prints a list of all users with their full name as description. - `__fish_complete_users` prints a list of all users with their full name as description.

View file

@ -1,6 +1,6 @@
# #
# Find files that complete $argv[1], has the suffix $argv[2], and # Find files that complete $argv[1], has the suffix $argv[2], and
# output them as completions with the description $argv[3] Both # output them as completions with the optional description $argv[3] Both
# $argv[1] and $argv[3] are optional, if only one is specified, it is # $argv[1] and $argv[3] are optional, if only one is specified, it is
# assumed to be the argument to complete. # assumed to be the argument to complete.
# #
@ -19,12 +19,12 @@ function __fish_complete_suffix -d "Complete using files"
case 1 case 1
set comp (commandline -ct) set comp (commandline -ct)
set suff $argv set suff $argv
set desc (mimedb -d $suff) set desc ""
case 2 case 2
set comp $argv[1] set comp $argv[1]
set suff $argv[2] set suff $argv[2]
set desc (mimedb -d $suff) set desc ""
case 3 case 3
set comp $argv[1] set comp $argv[1]
@ -45,8 +45,9 @@ function __fish_complete_suffix -d "Complete using files"
# #
# Also do directory completion, since there might be files # Also do directory completion, since there might be files
# with the correct suffix in a subdirectory # with the correct suffix in a subdirectory
# No need to describe directories (#279)
# #
__fish_complete_directories $comp __fish_complete_directories $comp ""
end end