mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
completions/mpv: speed up loading
Goes from 200 ms to 100 ms. Probably there is some overhead when calling complete in a loop; we might be able to fix that.
This commit is contained in:
parent
1c7b934402
commit
446f4efa65
|
@ -1,12 +1,6 @@
|
|||
set -l options (string replace -fr '^\s*--([\w-]+).*' '$1' -- (command mpv --list-options 2>/dev/null))
|
||||
for opt in $options
|
||||
complete -c mpv -l "$opt"
|
||||
end
|
||||
|
||||
set -l flag_options (string replace -fr '^\s*--([\w-]+).*Flag.*' '$1' -- (command mpv --list-options 2>/dev/null))
|
||||
for flag_opt in $flag_options
|
||||
complete -c mpv -l "no-$flag_opt"
|
||||
end
|
||||
set -l options (command mpv --list-options 2>/dev/null)
|
||||
complete -c mpv -l(string replace -fr '^\s*--([\w-]+).*' '$1' -- $options)
|
||||
complete -c mpv -lno-(string replace -fr '^\s*--([\w-]+).*Flag.*' '$1' -- $options)
|
||||
|
||||
complete -c mpv -l start -x -d "Seek to given position (%, s, hh:mm:ss)"
|
||||
complete -c mpv -l no-audio -d "Disable audio"
|
||||
|
|
Loading…
Reference in New Issue
Block a user