2019-11-30 11:27:17 +00:00
|
|
|
function __fish_complete_unrar -d "Peek inside of archives and list all files"
|
2024-01-22 06:42:45 +00:00
|
|
|
set -l cmd (commandline -pxc)
|
2019-11-30 11:27:17 +00:00
|
|
|
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)
|
2020-02-23 09:55:30 +00:00
|
|
|
printf "%s\tArchived file\n" $file_list
|
2019-11-30 11:27:17 +00:00
|
|
|
end
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2006-11-02 23:57:27 +00:00
|
|
|
|
|
|
|
complete -c unrar -a "(__fish_complete_unrar)"
|
|
|
|
|
2020-03-09 18:36:12 +00:00
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a e -d "Extract files to current directory"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a l -d "List archive"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a lt -d "List archive (technical)"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a lb -d "List archive (bare)"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a p -d "Print file to stdout"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a t -d "Test archive files"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a v -d "Verbosely list archive"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a vt -d "Verbosely list archive (technical)"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a vb -d "Verbosely list archive (bare)"
|
|
|
|
complete -x -c unrar -n __fish_use_subcommand -a x -d "Extract files with full path"
|