fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a9618477e
master
1function __fish_complete_unrar -d"Peek inside of archives and list all files" 2set -l cmd( commandline -pxc) 3set -e cmd[ 1 ] 4for iin $cmd 5switch $i 6case '-*' 7continue 8 9case '*.rar' 10if test -f $i 11set -l file_list( unrar vb$i ) 12printf "%s\tArchived file\n" $file_list 13end 14return 15end 16end 17end 18 19complete -c unrar -a"(__fish_complete_unrar)" 20 21complete -x -c unrar -n __fish_use_subcommand -a e -d"Extract files to current directory" 22complete -x -c unrar -n __fish_use_subcommand -a l -d"List archive" 23complete -x -c unrar -n __fish_use_subcommand -a lt -d"List archive (technical)" 24complete -x -c unrar -n __fish_use_subcommand -a lb -d"List archive (bare)" 25complete -x -c unrar -n __fish_use_subcommand -a p -d"Print file to stdout" 26complete -x -c unrar -n __fish_use_subcommand -a t -d"Test archive files" 27complete -x -c unrar -n __fish_use_subcommand -a v -d"Verbosely list archive" 28complete -x -c unrar -n __fish_use_subcommand -a vt -d"Verbosely list archive (technical)" 29complete -x -c unrar -n __fish_use_subcommand -a vb -d"Verbosely list archive (bare)" 30complete -x -c unrar -n __fish_use_subcommand -a x -d"Extract files with full path"