Skip to content

Commit 660c721

Browse files
committed
Improve fish file completion
1 parent 9afa25c commit 660c721

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

completions/xh.fish

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Complete paths after @ in options:
2+
function __xh_complete_data
3+
string match -qr '^(?<prefix>.*@)(?<path>.*)' -- (commandline -ct)
4+
printf '%s\n' -- $prefix(__fish_complete_path $path)
5+
end
6+
complete -c xh -n 'string match -qr "@" -- (commandline -ct)' -kxa "(__xh_complete_data)"
7+
18
complete -c xh -l raw -d 'Pass raw request data without extra processing' -r
29
complete -c xh -l pretty -d 'Controls output processing' -r -f -a "all\t'(default) Enable both coloring and formatting'
310
colors\t'Apply syntax highlighting to output'

0 commit comments

Comments
 (0)