completions/ant: don't look at tokens from adjacent commands

This commit is contained in:
Johannes Altmanninger 2024-01-06 08:42:25 +01:00
parent 06de374ffd
commit f42b7d30b3

View file

@ -2,7 +2,7 @@
function __fish_complete_ant_targets -d "Print list of targets from build.xml and imported files" function __fish_complete_ant_targets -d "Print list of targets from build.xml and imported files"
function __get_buildfile -d "Get a buildfile that will be used by ant" function __get_buildfile -d "Get a buildfile that will be used by ant"
set -l tokens $argv # tokens from 'commandline -co' set -l tokens $argv # tokens from 'commandline -opc'
set -l prev $tokens[1] set -l prev $tokens[1]
set -l buildfile "build.xml" set -l buildfile "build.xml"
for token in $argv[2..-1] for token in $argv[2..-1]
@ -56,7 +56,7 @@ function __fish_complete_ant_targets -d "Print list of targets from build.xml an
end end
# completion for ant targets # completion for ant targets
complete -x -c ant -a "(__fish_complete_ant_targets (commandline -co))" complete -x -c ant -a "(__fish_complete_ant_targets (commandline -opc))"
# Script Options: # Script Options:
complete -f -c ant -l help -l h -d 'print help message and ant help' complete -f -c ant -l help -l h -d 'print help message and ant help'