diff options
author | 2006-11-03 09:57:27 +1000 | |
---|---|---|
committer | 2006-11-03 09:57:27 +1000 | |
commit | c41986a63f3f28cd13be211eca8f87df4e0e0528 (patch) | |
tree | 19275620f51261303b5ba06a8f825db4e9d3f8a9 /share/functions/__fish_complete_unrar.fish | |
parent | bedf8ea55ee2ea522cca82b1529968ebabf8743e (diff) |
Add command specific completions for unrar command (No switches yet, only commands and files in archive)
darcs-hash:20061102235727-ac50b-7b7638289be4de52b4e3e3d109ad3167b7285023.gz
Diffstat (limited to 'share/functions/__fish_complete_unrar.fish')
-rw-r--r-- | share/functions/__fish_complete_unrar.fish | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/share/functions/__fish_complete_unrar.fish b/share/functions/__fish_complete_unrar.fish new file mode 100644 index 00000000..b9a0fda1 --- /dev/null +++ b/share/functions/__fish_complete_unrar.fish @@ -0,0 +1,21 @@ + +function __fish_complete_unrar -d "Peek inside of archives and list all files" + + set -l cmd (commandline -poc) + set -e cmd[1] + for i in $cmd + switch $i + case '-*' + continue + + case '*.rar' + if test -f $i + set -l file_list (unrar vb $i) + printf (_ "%s\tArchived file\n") $file_list + end + return + end + end +end + + |