kongplete isn't smart about positional arguments. If you have a config that takes one argument, it will continue to run that completion multiple times.
For instance, if you have a command that diffs exactly two files like diff <file 1> <file 2>, completion for the command diff a.txt b.txt would run the completion a third time even though diff doesn't take a third argument.
This is because https://github.com/posener/complete/ doesn't have a concept of positional arguments. It only provides an Args field where you can add one predictor for all arguments in the command.
One idea for addressing this is to generate predictors that respond differently based on how many tokens are between the current cursor and the subcommand it's generating completions for.
kongplete isn't smart about positional arguments. If you have a config that takes one argument, it will continue to run that completion multiple times.
For instance, if you have a command that diffs exactly two files like
diff <file 1> <file 2>
, completion for the commanddiff a.txt b.txt
would run the completion a third time even though diff doesn't take a third argument.This is because https://github.com/posener/complete/ doesn't have a concept of positional arguments. It only provides an
Args
field where you can add one predictor for all arguments in the command.One idea for addressing this is to generate predictors that respond differently based on how many tokens are between the current cursor and the subcommand it's generating completions for.