From 7fa69ef8bed3511d3b1bb5bf46fa0281f61b43aa Mon Sep 17 00:00:00 2001 From: David Adam Date: Thu, 23 Jul 2015 14:22:27 +0800 Subject: [PATCH] __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. --- doc_src/index.hdr.in | 2 +- share/functions/__fish_complete_suffix.fish | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 2e059b415..d74aa124c 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -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_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. diff --git a/share/functions/__fish_complete_suffix.fish b/share/functions/__fish_complete_suffix.fish index 1f3207063..d0c264db2 100644 --- a/share/functions/__fish_complete_suffix.fish +++ b/share/functions/__fish_complete_suffix.fish @@ -1,6 +1,6 @@ # # 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 # assumed to be the argument to complete. # @@ -19,12 +19,12 @@ function __fish_complete_suffix -d "Complete using files" case 1 set comp (commandline -ct) set suff $argv - set desc (mimedb -d $suff) + set desc "" case 2 set comp $argv[1] set suff $argv[2] - set desc (mimedb -d $suff) + set desc "" case 3 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 # with the correct suffix in a subdirectory + # No need to describe directories (#279) # - __fish_complete_directories $comp + __fish_complete_directories $comp "" end