> On Sun, Jan 27, 2019 at 6:14 PM Chet Ramey <chet.ra...@case.edu> wrote: >
> > I prefer this behavior, at least to the extent that the function name > argument to -F can't contain any shell metacharacters. > But it can, and that's the problem. E.g.: $ complete -F 'meta;char' -- cmd yields no errors. `complete` is perfectly happy to accept literally any argument to "-F", it seems. Empty string, multiple words, metacharacters, you name it---so long as it doesn't contain a null byte, `complete` won't so much as blink. This fact *combined* with the fact that `complete -p` doesn't quote it yields problems. Continuing the above: $ complete -p -- cmd ==> complete -F meta;char -- cmd > [...] you would not be able to define a valid shell function with > that name. > No, but `complete` doesn't care. Surely it should care, right? At the very least, if `complete -F` isn't going to error, `complete -p` shouldn't spit out the wrong result.