mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
Add Makefile --file detection to completion
This commit is contained in:
committed by
ridiculousfish
parent
44e2c28255
commit
7583d57b63
@@ -1,11 +1,14 @@
|
||||
# Completions for make
|
||||
function __fish_complete_make_targets
|
||||
set directory (string replace -r '^make .*(-C ?|--directory[= ]?)([^ ]*) .*$' '$2' -- $argv)
|
||||
if test $status -eq 0 -a -d $directory
|
||||
__fish_print_make_targets $directory
|
||||
else
|
||||
__fish_print_make_targets
|
||||
set directory (string replace -r '^make .*(-C ?|--directory(=| +))([^ ]*) .*$' '$3' -- $argv)
|
||||
if not test $status -eq 0 -a -d $directory
|
||||
set directory ''
|
||||
end
|
||||
set file (string replace -r '^make .*(-f ?|--file(=| +))([^ ]*) .*$' '$3' -- $argv)
|
||||
if not test $status -eq 0 -a -f $file
|
||||
set file ''
|
||||
end
|
||||
__fish_print_make_targets "$directory" "$file"
|
||||
end
|
||||
|
||||
# This completion reenables file completion on
|
||||
|
||||
Reference in New Issue
Block a user