mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
18 lines
547 B
Fish
18 lines
547 B
Fish
function __fish_d2__complete_layouts
|
|
set -l layouts (d2 layout |
|
|
sed -n '3,$p' |
|
|
sed -n '/^$/,$d; p' |
|
|
string replace --regex '^(\w+)\s+\(bundled\)' '$1')
|
|
|
|
set -l identifiers
|
|
set -l descriptions
|
|
|
|
for layout in $layouts
|
|
set -a identifiers (string replace --regex ' - .+$' '' -- $layouts)
|
|
set -a descriptions (string replace --regex '^\w+ - ' '' -- $layouts)
|
|
end
|
|
|
|
for index in (seq (count $layouts))
|
|
printf '%s\t%s\n' $identifiers[$index] $descriptions[$index]
|
|
end
|
|
end
|