fish-shell/share/functions/__fish_complete_unrar.fish
axel c41986a63f Add command specific completions for unrar command (No switches yet, only commands and files in archive)
darcs-hash:20061102235727-ac50b-7b7638289be4de52b4e3e3d109ad3167b7285023.gz
2006-11-03 09:57:27 +10:00

22 lines
337 B
Fish

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