fish-shell/share/functions/__fish_print_make_targets.fish
2012-06-17 15:01:04 -07:00

9 lines
347 B
Fish

function __fish_print_make_targets
set files Makefile makefile GNUmakefile
# Some seds (e.g. on Mac OS X), don't support \n in the RHS
# Use a literal newline instead
# http://sed.sourceforge.net/sedfaq4.html#s4.1
sgrep -h -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $files | cut -d ":" -f 1 | sed -e 's/^ *//;s/ *$//;s/ */\\
/g' ^/dev/null
end