[Top][All Lists]

[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.


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:


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]