Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hooking into tab completion in C

Tags:

c++

c

bash

Is there anyway that I can hook into the tab completion for bash from a C or C++ progra, specifically for arguments.

For example if I wanted to do ./myprogram stTAB it would complete to start.

I wasn't sure if this was something I can hook into during compile and put in like the metadata or if its a bash call/script that I have to make to register the tab completions with bash.

like image 779
csteifel Avatar asked Mar 30 '12 04:03

csteifel


1 Answers

It is indeed possible to customize completion in bash, although it's not something a program can do for itself. Here is the start of a two-part article that explains what you need to know.

like image 162
Ernest Friedman-Hill Avatar answered Nov 07 '22 08:11

Ernest Friedman-Hill