I made an alias to save some keystrokes with working with systemd:
$ alias sctl='systemctl'
However, this breaks tab completion for the subcommands. Is it possible to alias a command without breaking tab completion?
First find out which complete-function is used for the systemctl
command:
complete | grep " systemctl$"
The output looks like this:
complete -F _functionname systemctl
Then use:
complete -F _functionname sctl
To register the function for the completion of your alias.
Now, when you type sctl <tab><tab>
, the same suggestions as when you type systemctl
will appear.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments