chiark / gitweb /
shell-completion: replace printf with echo
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Apr 2013 23:06:00 +0000 (19:06 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Apr 2013 23:47:16 +0000 (19:47 -0400)
commit79c1638303142b81e1b72dd5bde0c656ccf19999
treed94ffbc1f7a4726a14daddcd818d3a3c7fe46aa1
parent75add28aa17678fbf5b10947027efe7ac75d113d
shell-completion: replace printf with echo

It is faster to use a bash built-in, then to invoke an external
program. The problem of unit names starting with a dash is solved
by prepending a space. Spaces are ignored anyway.

For zsh, replace echo "$unit", which is vulnerable to dashes,
with echo " $unit".
shell-completion/bash/systemctl
shell-completion/systemd-zsh-completion.zsh