On 1/24/19 12:24 PM, Great Big Dot wrote:

> Bash Version: 5.0
> Patch Level: 0
> Release Status: release
> 
> 
> Description:
>     According to the manual's section on the `complete` builtin:
> 
>     > "If the -p option is supplied, or if no options are supplied,
>       existing completion specifications are printed in a way that allows
>       them to be reused as input."
> 
>     Unfortunately, there is at least one edge cases that, despite being
>     invalid, are considered valid by `complete`, and the proper measures to
>     deal with it are not taken. Namely:
> 
>     $ complete -F 'bad func' -- cmd        # No error is triggered here...
>     $ complete -p -- cmd                   #
>     => complete -F bad func cmd            # Not quoted!!
> 
>     The expected behavior ought to be either that the first line yields an
>     error (e.g., "bash: `'bad func'': not a valid identifier"), 

I prefer this behavior, at least to the extent that the function name
argument to -F can't contain any shell metacharacters. Since those
characters would have to be quoted when defining the function, and you
can't quote function names when defining the function (at least for the
time being), you would not be able to define a valid shell function with
that name.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to