complete-ant-cmd.pl revision 5713
809N/A# Licensed to the Apache Software Foundation (ASF) under one or more 809N/A# contributor license agreements. See the NOTICE file distributed with 809N/A# this work for additional information regarding copyright ownership. 809N/A# The ASF licenses this file to You under the Apache License, Version 2.0 809N/A# (the "License"); you may not use this file except in compliance with 809N/A# the License. You may obtain a copy of the License at 0N/A# Unless required by applicable law or agreed to in writing, software 0N/A# distributed under the License is distributed on an "AS IS" BASIS, 0N/A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0N/A# See the License for the specific language governing permissions and 0N/A# limitations under the License. 0N/A# A script to allow Bash or Z-Shell to complete an Ant command-line. 0N/A# To install for Bash 2.0 or better, add the following to ~/.bashrc: 0N/A# $ complete -C complete-ant-cmd ant build.sh 0N/A# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc: 0N/A# function ant_complete () { 0N/A# local args_line args 0N/A# set -A args $args_line 0N/A# set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1) 0N/A# compctl -K ant_complete ant build.sh 0N/A# @author Mike Williams <mikew@cortexebusiness.com.au> 0N/A grep( /\.
xml$/,
glob(
"$word*" ));
0N/A # Look for build-file 0N/A # Run "ant -projecthelp" to list targets. Keep a cache of results in a 0N/A open(
HELP,
"$antCmd -projecthelp -f '$buildFile'|" ) ||
return();
0N/A # Read the target-cache 0N/A s/\r$//;
# for Cygwin