mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 16:12:49 +08:00
Add minor new completion for make command
darcs-hash:20060825154516-ac50b-80284df4f7dd6cd332f2b21f5c9bdc359cc00eca.gz
This commit is contained in:
parent
97c3e231f4
commit
046dd82995
|
@ -1,10 +1,19 @@
|
||||||
#Completions for make
|
# Completions for make
|
||||||
|
|
||||||
function __fish_print_make_targets
|
function __fish_print_make_targets
|
||||||
set files Makefile makefile GNUmakefile
|
set files Makefile makefile GNUmakefile
|
||||||
grep -h -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $files | cut -d ":" -f 1 | sed -e 's/^ *//;s/ *$//;s/ */\n/g' ^/dev/null
|
grep -h -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $files | cut -d ":" -f 1 | sed -e 's/^ *//;s/ *$//;s/ */\n/g' ^/dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This completion is a bit ugly. It reenables file completion on
|
||||||
|
# assignments, so e.g. 'make foo FILES=<tab>' will recive standard
|
||||||
|
# filename completion. Unfortunatly, this turns out to be a bit
|
||||||
|
# complicated to do.
|
||||||
|
|
||||||
|
set -l is_assignment "commandline -ct|grep '..*='"
|
||||||
|
set -l complete_file_assignment '(commandline -ct)(complete --do-complete=this_command_does_not_exist\ (commandline -ct|sed -e \'s/.*=//\'))'
|
||||||
|
complete -c make --condition $is_assignment -a $complete_file_assignment
|
||||||
|
|
||||||
complete -x -c make -a "(__fish_print_make_targets)" -d (N_ "Target")
|
complete -x -c make -a "(__fish_print_make_targets)" -d (N_ "Target")
|
||||||
complete -r -c make -s f -d (N_ "Use file as makefile") -r
|
complete -r -c make -s f -d (N_ "Use file as makefile") -r
|
||||||
complete -x -c make -s C -x -a "(__fish_complete_directory (commandline -ct))" -d (N_ "Change directory")
|
complete -x -c make -s C -x -a "(__fish_complete_directory (commandline -ct))" -d (N_ "Change directory")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user