diff options
author | liljencrantz <liljencrantz@gmail.com> | 2008-01-09 08:16:08 +1000 |
---|---|---|
committer | liljencrantz <liljencrantz@gmail.com> | 2008-01-09 08:16:08 +1000 |
commit | 9c38ed8238cb184b11ac349a70e8e9679783e183 (patch) | |
tree | 1f52ab526217a6ca12ab04fc3db3de1c253acc34 /share/functions/__fish_complete_ant_targets.fish | |
parent | cb59da7a6fb6f362d8104c6381b9980e417c8962 (diff) |
Improve ant completions. This patch comes from Steven Knight. (minor tweaks applied)
darcs-hash:20080108221608-75c98-a0c7f65c65fb2e2c68085c69e72caa4a2c86a029.gz
Diffstat (limited to 'share/functions/__fish_complete_ant_targets.fish')
-rw-r--r-- | share/functions/__fish_complete_ant_targets.fish | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/share/functions/__fish_complete_ant_targets.fish b/share/functions/__fish_complete_ant_targets.fish index 55b77e44..b1447ce1 100644 --- a/share/functions/__fish_complete_ant_targets.fish +++ b/share/functions/__fish_complete_ant_targets.fish @@ -1,7 +1,15 @@ +function __fish_complete_ant_targets -d "Print list of targets from build.xml and imported files" + set -l buildfile "build.xml" + if test -f $buildfile + # show ant targets + __fish_print_ant_targets $buildfile -function __fish_complete_ant_targets -d "Print list of targets from build.xml" - if test -f build.xml - sed -n "s/ *<target name=[\"']\([^\"']*\)[\"'].*/\1/p" < build.xml + # find files with buildfile + set files (sed -n "s/^.*<import[^>]* file=[\"']\([^\"']*\)[\"'].*\$/\1/p" < $buildfile) + + # iterate through files and display their targets + for file in $files; + __fish_filter_ant_targets $file + end end end - |