I found the specification of _arguments that describes the action part. I don't understand, however, why the -r applies only to these, since the compadd specification of this option does not describe this limitation Pier Paolo Grassi Il giorno sab 7 mag 2022 alle ore 22:31 Pier Paolo Grassi < pierpaolog@gmail.com> ha scritto: > I would like to test your solution, but idk how to add an action part to > my $categories_array. Right now it is just an array of strings to be used > for completion. > > Pier Paolo Grassi > > > Il giorno sab 7 mag 2022 alle ore 22:29 Pier Paolo Grassi < > pierpaolog@gmail.com> ha scritto: > >> > It should already be happening that way. If you type a space or >> another return after the comma, it should disappear. >> >> yes it is removed when I press a space after selection, and even if I >> press enter after the selection. But this way, in the enter case, the line >> is accepted and executed. >> What I would like is for the comma not to be inserted after the >> completion, I would like to insert it by myself if I want to insert >> multiple arguments. So when I press enter in the menu selection the voice >> is selected and the line is: >> >> func acat >> >> instead of >> >> func acat, >> >> thanks >> >> >> Pier Paolo Grassi >> >> >> Il giorno sab 7 mag 2022 alle ore 22:12 Bart Schaefer < >> schaefer@brasslantern.com> ha scritto: >> >>> On Sat, May 7, 2022 at 3:41 AM Pier Paolo Grassi >>> wrote: >>> >>>> >>>> _values -s , categories $categories_array >>>> >>>> > func a >>>> >>>> > func acat, >>>> >>>> I would like that the comma was not added automatically, or at least to >>>> be removed automatically when I select a voice in menu selection with enter. >>>> is this possible? >>>> >>> >>> It should already be happening that way. If you type a space or another >>> return after the comma, it should disappear. >>> >>> If that's not happening the way you like, you can try some variation of >>> >>> remove_comma=(-r '[:alnum:] \t\n\-') >>> _values -O remove_comma -s , categories $categories_array >>> >>> to remove the comma when you type (in that example) anything >>> alphanumeric or whitespace, but whether that works depends on how you've >>> defined the specs in $categories_array (-O applies only to specs that have >>> an "action" component). >>> >>> >>>