If a command has either an option or argument with an array type and completion set to anything, the completions will only be used for the first item typed into the terminal. Any following items wont get any completions.
In the case of an option with parsing set to one of the single value options, the option and value will only be suggested the first time. Afterwards the option will no longer be given as a completion.
ArgumentParser version: 1.2.2
Swift version:
Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0
Checklist
[x] If possible, I've reproduced the issue using the main branch of this package
Install the zsh completions for it using {Command name} --generate-completion-script zsh and putting the completions in the correct location for your terminal setup. For me it's ~/.oh-my-zsh/completions.
Start typing the command using completions for the option
Type {Command name} --o then press tab to complete the option name
Type a then tab to complete the word alfa
Type --o then press tab again
Or, start typing the command using completions for the argument
Type {Command name} a then press tab to complete the word alfa
Type a then press tab again
Expected behavior
For step 3, it should complete --option again since it can be passed multiple times to the command to build the option array.
For step 4, it should complete alfa again since it be passed multiple strings to build the argument array.
Actual behavior
After pressing tab the expected word is not completed. Either nothing is completed or possibly a different flag/option/argument is completed depending on what letter is typed, ie. it might complete --help depending on the terminal's completion settings.
If a command has either an option or argument with an array type and
completion
set to anything, the completions will only be used for the first item typed into the terminal. Any following items wont get any completions.In the case of an option with parsing set to one of the single value options, the option and value will only be suggested the first time. Afterwards the option will no longer be given as a completion.
ArgumentParser version: 1.2.2 Swift version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) Target: arm64-apple-macosx13.0
Checklist
main
branch of this packageSteps to Reproduce
{Command name} --generate-completion-script zsh
and putting the completions in the correct location for your terminal setup. For me it's~/.oh-my-zsh/completions
.{Command name} --o
then press tab to complete the option namea
then tab to complete the wordalfa
--o
then press tab again{Command name} a
then press tab to complete the wordalfa
a
then press tab againExpected behavior
For step 3, it should complete
--option
again since it can be passed multiple times to the command to build theoption
array.For step 4, it should complete
alfa
again since it be passed multiple strings to build theargument
array.Actual behavior
After pressing tab the expected word is not completed. Either nothing is completed or possibly a different flag/option/argument is completed depending on what letter is typed, ie. it might complete
--help
depending on the terminal's completion settings.