shell-completion: redirect all errors from systemctl to /dev/null
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 11 Jan 2017 19:45:19 +0000 (14:45 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 11 Jan 2017 21:37:34 +0000 (16:37 -0500)
Completion scripts should not generate errors, ever.

https://bugzilla.redhat.com/show_bug.cgi?id=1409649

shell-completion/bash/systemctl.in
shell-completion/zsh/_systemctl.in

index dcf71a1..34589e2 100644 (file)
@@ -19,7 +19,7 @@
 
 __systemctl() {
         local mode=$1; shift 1
-        systemctl $mode --full --no-legend "$@"
+        systemctl $mode --full --no-legend "$@" 2>/dev/null
 }
 
 __systemd_properties() {
index 03a1c93..d77a2df 100644 (file)
@@ -91,7 +91,7 @@
 
 __systemctl()
 {
-  systemctl $_sys_service_mgr --full --no-legend --no-pager "$@"
+  systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2>/dev/null
 }