fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMerge branch 'completions-to-use-expanded-tokens'a9618477e

master
1.3 KiB30 linesraw
1function __fish_complete_unrar -d "Peek inside of archives and list all files"
2    set -l cmd (commandline -pxc)
3    set -e cmd[1]
4    for i in $cmd
5        switch $i
6            case '-*'
7                continue
8
9            case '*.rar'
10                if test -f $i
11                    set -l file_list (unrar vb $i)
12                    printf "%s\tArchived file\n" $file_list
13                end
14                return
15        end
16    end
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"