Programmable completion function for shell aliases.
If you are wondering how to make the programmable completion functionality as provided by the shell work with aliases automagically, then this program is your friend.
This program provides a shell alias completion tool which:
Works with all properly defined aliases, even those aliasing to themselves.
Uses a single function to complete all aliases, which means you don’t have to define different functions for different aliases.
Completes aliases automagically as you type in the command line and press
<Tab>. Nothing else.
Installation & Usage
Currently the only supported shell is Bash.
To use this program with Bash:
Install bash-completion, which is a dependency of this program.
You may find it already installed on your system or you may be able to install it via your system’s package manager.
Append the content of
cat completions/bash_completion.sh >> ~/.bash_completion
~/.bash_completionto setup completion functions for your own aliases. Usually this involves uncomment and edit some comment lines like this:
#complete -F _complete_alias myalias
If you want to complete for alias
foo, then edit this line into:
complete -F _complete_alias foo
To complete a command line with an alias, simply press
complete -F _complete_alias sctl
sctl<space> will show
$ sctl <Tab> add-requires add-wants cancel cat condreload ...
The source code is licensed under the GNU General Public License v3.0.
Copyright (C) 2016-2017 Cyker Way
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.