Just how to define a personalized autocomplete for details commands?

Exists a means to have bash recognize specifically what to present when you double tab? As an example I have a python manuscript scpy which calls for a pair debates. As an example like apt-get, if you double tab offers you

autoclean        build-dep        clean            dselect-upgrade  purge            source           upgrade
autoremove       check            dist-upgrade     install          remove           update  

Exists a means to do that for your very own scripts/programs? Do I require to cover my python manuscript in a bash manuscript?

0
2019-05-07 01:06:26
Source Share
Answers: 1

The most convenient means of doing this is to include a covering manuscript in /etc/bash_completion.d/. The standard framework of this documents is a straightforward function that executes the conclusion and afterwards conjuration of complete which is a bash builtin. As opposed to explain on just how to make use of complete, I recommend you read An Introduction to Bash Completion. Component 1 covers the essentials and also Part 2 gets involved in just how you would certainly deal with creating a conclusion manuscript.

A denser summary of bash conclusion can be located in the "Programmable Completion" area of man bash (you can type "/ Programmable Completion" and afterwards press 'n' a couple of times to arrive promptly. Or, if you are really feeling good luck, "g 2140 RETURN").

0
2019-05-08 03:55:46
Source