mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
11a60c8374
I hate doing this but I am tired of touching a fish script as part of some change and having `make style` radically change it. Which makes editing fish scripts more painful than it needs to be. It is time to do a wholesale reformatting of these scripts to conform to the documented style as implemented by the `fish_indent` program.
26 lines
867 B
Fish
26 lines
867 B
Fish
function __fish_complete_lpr_option --description 'Complete lpr option'
|
|
set -l optstr (commandline -t)
|
|
switch $optstr
|
|
case '*=*'
|
|
set -l IFS =
|
|
echo $optstr | read -l opt val
|
|
set -l descr
|
|
for l in (lpoptions -l ^/dev/null | string match -- "*$opt*" | string replace -r '.*/(.*):\s*(.*)$' '$1 $2' | string split " ")
|
|
if not set -q descr[1]
|
|
set descr $l
|
|
continue
|
|
end
|
|
set -l default ''
|
|
if string match -q '\**' -- $l
|
|
set default 'Default '
|
|
set l (string sub -s 2 -- $l)
|
|
end
|
|
echo $opt=$l\t$default$descr
|
|
end
|
|
case '*'
|
|
lpoptions -l ^/dev/null | string replace -r '(.*)/(.*):.*$' '$1=\t$2'
|
|
end
|
|
|
|
|
|
end
|