How do you make an alias or function that retains 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.