fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
895 B24 linesraw
1# localization: skip(private)
2function __fish_complete_lpr_option --description 'Complete lpr option'
3    set -l optstr "$(commandline -t)"
4    switch $optstr
5        case '*=*'
6            string split -m1 = -- "$optstr" | read -l opt val
7            set -l descr
8            for l in (lpoptions -l 2>/dev/null | string match -- "*$opt*" | string replace -r '.*/(.*):\s*(.*)$' '$1 $2' | string split " ")
9                if not set -q descr[1]
10                    set descr $l
11                    continue
12                end
13                set -l default ''
14                if string match -q '\**' -- $l
15                    set default 'Default '
16                    set l (string sub -s 2 -- $l)
17                end
18                echo $opt=$l\t$default$descr
19            end
20        case '*'
21            lpoptions -l 2>/dev/null | string replace -r '(.*)/(.*):.*$' '$1=\t$2'
22    end
23
24end