[systemd-devel] bash autocompletion

Lennart Poettering lennart at poettering.net
Sun Sep 5 10:35:11 PDT 2010


On Sun, 05.09.10 06:53, Michael Biebl (mbiebl at gmail.com) wrote:

> Hi everyone,
> 
> attached is a first stab at bash completion support for systemctl.
> You need to have the bash-completion package installed (on Debian:
> apt-get install bash-completion), then simply copy the file to
> /etc/bash_completion.d/
> and either source /etc/bash_completion or only /etc/bash_completion.d/systemctl.
> 
> It's still a bit rough and incomplete, but I thought I'd share it anyway.
> Comments and improvements/patches most welcome.

Great Work!

I am really keen on shipping this with systemd itself. A few comments:

It probably makes sense to show all unit types for start/stop/..., not
only services, but maybe exclude devices. (i.e. blacklisting
devices instead of whitelisting services)

For "start" (and some other verbs) this should probably include the
contents of /lib/systemd/systemd/. And for templates (i.e. those units
with @ in their name) it would be cool to make the completion stop after
the @, so that the user can fill in an instnace name. Note sure hwo well
this would work with bash, though.

You probably want to use --full. (Hmm, though I am seeing that you
already noticed that)

But anyway, really great work. If you have a version that works well I
am happy to merge it, even if it is still incomplete!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list