I recently worked on creating a bash completion script for a project and I enjoyed it very much. In this post I will try to familiarize you with the process of creating a bash completion script.
What is bash completion?
Bash completion is a functionality through which bash helps users type their commands faster and easier. It accomplishes that by presenting possible options when users press the tab key while typing a command.
git git-receive-pack git-upload-archive
gitk git-shell git-upload-pack
How it works
The completion script is code that uses the builtin bash command complete to define which completion suggestions can be displayed for a given executable. The nature of the completion options vary from simple static to highly sophisticated.
It is good to provide such a functionality to users:
to save them from typing text when it can be auto-completed
to help them know what are the available continuations to their commands
Original URL: http://feedproxy.google.com/~r/feedsapi/BwPx/~3/ft1DJwY9wc4/bash-programmable-completion-tutorial