bug-bash
[Top][All Lists]
Advanced

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

get bash completion output programatically


From: acornejo
Subject: get bash completion output programatically
Date: Mon, 20 Feb 2017 11:59:44 -0800 (PST)
User-agent: G2/1.0

The title says it all.

Example:

get_completion "git a"
> add
> am
> annotate
> apply
> archive

get_completion "ls --a"
> --all
> --almost-all
> --author

There are various attempts to do it online, the most complete seems to be:

https://brbsix.github.io/2015/11/29/accessing-tab-completion-programmatically-in-bash/

Unfortunately, they all seem to be buggy and/or incomplete. For instance, the 
previous linked solution works with the 'git' example, but not with 'ls'. Also 
none seem to handle gracefully filename completion (i.e. 'git add ' returns 
empty instead of a list of the files in the current folder), etc.

Is there a robust solution to this problem? Could we add a hook to bash to do 
this? is this the right mailing list to post this?


reply via email to

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