2006-08-25 15:45:16 +00:00
|
|
|
# Completions for make
|
2016-12-07 10:05:14 +00:00
|
|
|
function __fish_complete_make_targets
|
2018-03-20 15:20:10 +00:00
|
|
|
set directory (string replace -r '^make .*(-C ?|--directory(=| +))([^ ]*) .*$' '$3' -- $argv)
|
|
|
|
if not test $status -eq 0 -a -d $directory
|
|
|
|
set directory ''
|
2016-12-07 10:05:14 +00:00
|
|
|
end
|
2018-03-20 15:20:10 +00:00
|
|
|
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"
|
2016-12-07 10:05:14 +00:00
|
|
|
end
|
2005-10-27 15:23:32 +00:00
|
|
|
|
2015-09-29 19:09:52 +00:00
|
|
|
# This completion reenables file completion on
|
|
|
|
# assignments, so e.g. 'make foo FILES=<tab>' will receive standard
|
|
|
|
# filename completion.
|
2018-05-12 16:52:04 +00:00
|
|
|
complete -c make -n 'commandline -ct | string match -q "*=*"' -a "(__fish_complete_make_targets (commandline -c))" -d "Target"
|
|
|
|
complete -f -c make -n 'commandline -ct | not string match -q "*=*"' -a "(__fish_complete_make_targets (commandline -c))" -d "Target"
|
|
|
|
complete -c make -s f -d "Use file as makefile" -r
|
2017-10-11 17:17:35 +00:00
|
|
|
complete -x -c make -s C -l directory -x -a "(__fish_complete_directories (commandline -ct))" -d "Change directory"
|
|
|
|
complete -c make -s d -d "Debug mode"
|
|
|
|
complete -c make -s e -d "Environment before makefile"
|
|
|
|
complete -c make -s i -d "Ignore errors"
|
|
|
|
complete -x -c make -s I -d "Search directory for makefile" -a "(__fish_complete_directories (commandline -ct))"
|
|
|
|
complete -x -c make -s j -d "Number of concurrent jobs"
|
|
|
|
complete -c make -s k -d "Continue after an error"
|
|
|
|
complete -c make -s l -d "Start when load drops"
|
|
|
|
complete -c make -s n -d "Do not execute commands"
|
|
|
|
complete -c make -s o -r -d "Ignore specified file"
|
|
|
|
complete -c make -s p -d "Print database"
|
|
|
|
complete -c make -s q -d "Question mode"
|
|
|
|
complete -c make -s r -d "Eliminate implicit rules"
|
|
|
|
complete -c make -s s -d "Quiet mode"
|
|
|
|
complete -c make -s S -d "Don't continue after an error"
|
|
|
|
complete -c make -s t -d "Touch files, don't run commands"
|
|
|
|
complete -c make -s v -d "Display version and exit"
|
|
|
|
complete -c make -s w -d "Print working directory"
|
|
|
|
complete -c make -s W -r -d "Pretend file is modified"
|
2005-09-20 13:31:55 +00:00
|
|
|
|