mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
34e27ff4c2
darcs-hash:20070116011828-ac50b-fb923dc877869ded4d506bbe0bc5364eea44092f.gz
39 lines
2.1 KiB
Fish
39 lines
2.1 KiB
Fish
# Completions for make
|
|
|
|
function __fish_print_make_targets
|
|
set files Makefile makefile GNUmakefile
|
|
sgrep -h -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $files | cut -d ":" -f 1 | sed -e 's/^ *//;s/ *$//;s/ */\n/g' ^/dev/null
|
|
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|sgrep '..*='"
|
|
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)" --description "Target"
|
|
complete -r -c make -s f --description "Use file as makefile" -r
|
|
complete -x -c make -s C -x -a "(__fish_complete_directories (commandline -ct))" --description "Change directory"
|
|
complete -c make -s d --description "Debug mode"
|
|
complete -c make -s e --description "Environment before makefile"
|
|
complete -c make -s i --description "Ignore errors"
|
|
complete -x -c make -s I --description "Search directory for makefile" -a "(__fish_complete_directories (commandline -ct))"
|
|
complete -x -c make -s j --description "Number of concurrent jobs"
|
|
complete -c make -s k --description "Continue after an error"
|
|
complete -c make -s l --description "Start when load drops"
|
|
complete -c make -s n --description "Do not execute commands"
|
|
complete -c make -s o -r --description "Ignore specified file"
|
|
complete -c make -s p --description "Print database"
|
|
complete -c make -s q --description "Question mode"
|
|
complete -c make -s r --description "Eliminate implicit rules"
|
|
complete -c make -s s --description "Quiet mode"
|
|
complete -c make -s S --description "Don't continue after an error"
|
|
complete -c make -s t --description "Touch files, don't run commands"
|
|
complete -c make -s v --description "Display version and exit"
|
|
complete -c make -s w --description "Print working directory"
|
|
complete -c make -s W -r --description "Pretend file is modified"
|
|
|