help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] programmable completions via compgen -F


From: Chet Ramey
Subject: Re: [Help-bash] programmable completions via compgen -F
Date: Fri, 11 Oct 2019 11:23:56 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 10/11/19 11:04 AM, Муравьев Александр wrote:
> Ok, I see. You are right.
> 
> As I understand, compgen designed to be used from within  a shell function
> generating possible completions to use readline and BASH logic, written in
> C. It not to process the part of specification, which is realized with BASH
> by design.
> 
> I was mistaken by the phrase from BASH man page "The matches will be
> generated in the same way as...".

`compgen' is a mechanism to provide convenient access to things that bash
implements internally, like the list of builtins, or variable or function
names, or signal names, and so on. This information is available in other
ways, but compgen provides it in a convenient, consistent way using the
same options that `complete' accepts.

It doesn't really make sense to call functions and commands that way --
just call them.


> 
> But how do you think, is it not a good feature to bring ability to use any
> complete specification with compgen and get according results?

I don't think it's any better than `complete'.

> It would dramatically improve ability of BASH completion system to be used
> in non-interactive mode as I think.

That's not a requirement.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]