From f77f71c17eca9707e808659f52e4943aa37ee226 Mon Sep 17 00:00:00 2001 From: David Adam Date: Thu, 23 Jul 2015 14:20:41 +0800 Subject: [PATCH] __fish_{filter,complete}_mime: drop from tree These are undocumented and unused, and rely on mimedb which is being removed from the tree. --- share/functions/__fish_complete_mime.fish | 27 ----------------------- share/functions/__fish_filter_mime.fish | 26 ---------------------- 2 files changed, 53 deletions(-) delete mode 100644 share/functions/__fish_complete_mime.fish delete mode 100644 share/functions/__fish_filter_mime.fish diff --git a/share/functions/__fish_complete_mime.fish b/share/functions/__fish_complete_mime.fish deleted file mode 100644 index 3639d31e6..000000000 --- a/share/functions/__fish_complete_mime.fish +++ /dev/null @@ -1,27 +0,0 @@ - -function __fish_complete_mime -d "Complete using text files" - # Find all possible file completions - set -l all - set -l comp (commandline -ct) - set -l base (echo $comp | sed -e 's/\.[a-zA-Z0-9]*$//') - set -l mimetype $argv[1] - eval "set all $base*" - - # Select text files only - set -l files (__fish_filter_mime $mimetype $all) - - # Get descriptions for files - set desc (mimedb -d $files) - - # Format completions and descriptions - if count $files > /dev/null - set -l res - for i in (seq (count $files)) - set res $res $files[$i]\t$desc[$i] - end - - if test $res[1] - printf "%s\n" $res - end - end -end diff --git a/share/functions/__fish_filter_mime.fish b/share/functions/__fish_filter_mime.fish deleted file mode 100644 index f04332d6c..000000000 --- a/share/functions/__fish_filter_mime.fish +++ /dev/null @@ -1,26 +0,0 @@ -# -# $argv[1] is a mimetype. The mimetype may contain wildcards. All -# following arguments are filenames. Filenames matching the mimetype -# are returned. -# - -function __fish_filter_mime -d "Select files with a specific mimetype" - - set -l mime_search $argv[1] - set -e argv[1] - - if not set -l mime (mimedb -f $argv) - return 1 - end - - if count $mime > /dev/null - set -l res - for i in (seq (count $mime)) - switch $mime[$i] - case $mime_search - set res $res $argv[$i] - end - end - printf "%s\n" $res - end -end