Package: systemd
Version: 37-1
Severity: normal
Tags: patch

Bash autocompletion for at least the reload and stop action is broken, because
__get_active_units is getting confused by the legend added by systemctl. The 
attached
patch fixes this by supplying the --no-legend argument for all __get_*_units 
calls.

root@schleppi:/etc/bash_completion.d# systemctl reloadFailed to issue method 
call: Unit name UNIT is not valid.
Failed to issue method call: Unit name UNIT is not valid.


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages systemd depends on:
ii  initscripts         2.88dsf-13.12
ii  libacl1             2.2.51-4     
ii  libaudit0           1.7.18-1     
ii  libc6               2.13-21      
ii  libcap2             1:2.22-1     
ii  libcryptsetup1      2:1.3.0-3    
ii  libdbus-1-3         1.4.16-1     
ii  libpam0g            1.1.3-6      
ii  libselinux1         2.1.0-4      
ii  libsystemd-daemon0  37-1         
ii  libsystemd-login0   37-1         
ii  libudev0            175-2        
ii  libwrap0            7.6.q-21     
ii  udev                175-2        
ii  util-linux          2.19.1-5     

Versions of packages systemd recommends:
ii  libpam-systemd  37-1

Versions of packages systemd suggests:
ii  python       2.7.2-9
ii  systemd-gui  37-1   

-- no debconf information
--- systemctl-bash-completion.sh	2011-12-02 14:50:40.541312627 +0100
+++ /etc/bash_completion.d/systemctl-bash-completion.sh	2011-12-02 14:51:29.561555683 +0100
@@ -32,10 +32,10 @@
         done
 }
 
-__get_all_units      () { systemctl list-units --full --all | awk '                 {print $1}' ; }
-__get_active_units   () { systemctl list-units --full       | awk '                 {print $1}' ; }
-__get_inactive_units () { systemctl list-units --full --all | awk '$3 == "inactive" {print $1}' ; }
-__get_failed_units   () { systemctl list-units --full       | awk '$3 == "failed"   {print $1}' ; }
+__get_all_units      () { systemctl list-units --full --all --no-legend | awk '                 {print $1}' ; }
+__get_active_units   () { systemctl list-units --full --no-legend       | awk '                 {print $1}' ; }
+__get_inactive_units () { systemctl list-units --full --all --no-legend | awk '$3 == "inactive" {print $1}' ; }
+__get_failed_units   () { systemctl list-units --full --no-legend       | awk '$3 == "failed"   {print $1}' ; }
 
 _systemctl () {
         local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}

Reply via email to