summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2020-04-17 11:40:03 +0200
committerLennart Poettering <lennart@poettering.net>2020-04-17 19:15:49 +0200
commit1cabd2d0c56b7de73e4a4fb645f3bbed4a528d2c (patch)
treed51abd3c61a38ce23442937804e4aceb0da058b3 /shell-completion
parent75dff0f910e6f9f49344a1f276b4d37a76586de6 (diff)
downloadsystemd-1cabd2d0c56b7de73e4a4fb645f3bbed4a528d2c.tar.gz
systemctl: hide first column with --plain instead of --no-legend
Hiding the first column, which may contain bullet circles, with --no-legend is undocumented and potentially unexpected. On the other hand, not printing bullet circles with --plain is documented so hiding the column with that switch is sensible. The combination "--full --no-legend --no-pager --plain" is appropriate for automated processing of systemctl output.
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/bash/systemctl.in2
-rw-r--r--shell-completion/bash/systemd-analyze2
-rw-r--r--shell-completion/bash/systemd-cgls2
-rw-r--r--shell-completion/bash/systemd-nspawn2
-rw-r--r--shell-completion/bash/systemd-run2
-rw-r--r--shell-completion/bash/udevadm2
-rw-r--r--shell-completion/zsh/_systemctl.in2
-rw-r--r--shell-completion/zsh/_systemd-run2
8 files changed, 8 insertions, 8 deletions
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index f81dafba8e..fdbe32e5f7 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -7,7 +7,7 @@
__systemctl() {
local mode=$1; shift 1
- systemctl $mode --full --no-legend --no-pager "$@" 2>/dev/null
+ systemctl $mode --full --no-legend --no-pager --plain "$@" 2>/dev/null
}
__systemd_properties() {
diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze
index 1b4f1b0d10..0c61f54504 100644
--- a/shell-completion/bash/systemd-analyze
+++ b/shell-completion/bash/systemd-analyze
@@ -31,7 +31,7 @@ __get_machines() {
}
__get_services() {
- systemctl list-units --no-legend --no-pager -t service --all $1 | \
+ systemctl list-units --no-legend --no-pager --plain -t service --all $1 | \
{ while read -r a b c; do [[ $b == "loaded" ]]; echo " $a"; done }
}
diff --git a/shell-completion/bash/systemd-cgls b/shell-completion/bash/systemd-cgls
index 10f6b38fcc..ae41f8ba5a 100644
--- a/shell-completion/bash/systemd-cgls
+++ b/shell-completion/bash/systemd-cgls
@@ -29,7 +29,7 @@ __get_machines() {
}
__get_units_have_cgroup() {
- systemctl $1 list-units | {
+ systemctl $1 --full --no-legend --no-pager --plain list-units | {
while read -r a b c d; do
[[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a"
done
diff --git a/shell-completion/bash/systemd-nspawn b/shell-completion/bash/systemd-nspawn
index d263fd5dd9..a731167680 100644
--- a/shell-completion/bash/systemd-nspawn
+++ b/shell-completion/bash/systemd-nspawn
@@ -30,7 +30,7 @@ __get_users() {
__get_slices() {
local a b
- systemctl list-units -t slice --no-legend --no-pager | { while read a b; do echo " $a"; done; };
+ systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; };
}
__get_machines() {
diff --git a/shell-completion/bash/systemd-run b/shell-completion/bash/systemd-run
index 71692aa19c..88f4443ad9 100644
--- a/shell-completion/bash/systemd-run
+++ b/shell-completion/bash/systemd-run
@@ -18,7 +18,7 @@
__systemctl() {
local mode=$1; shift 1
- systemctl $mode --full --no-legend "$@"
+ systemctl $mode --full --no-legend --no-pager --plain "$@"
}
__get_slice_units () { __systemctl $1 list-units --all -t slice \
diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
index cb12c25538..76126a6329 100644
--- a/shell-completion/bash/udevadm
+++ b/shell-completion/bash/udevadm
@@ -38,7 +38,7 @@ __get_all_devs() {
}
__get_all_device_units() {
- systemctl list-units -t device --full --no-legend --no-pager 2>/dev/null | \
+ systemctl list-units -t device --full --no-legend --no-pager --plain 2>/dev/null | \
{ while read -r a b; do echo "$a"; done; }
}
diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 66bf03d058..c067bf8f27 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -145,7 +145,7 @@
# @todo _systemd-run has a helper with the same name, so we must redefine
__systemctl()
{
- systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2>/dev/null
+ systemctl $_sys_service_mgr --full --no-legend --no-pager --plain "$@" 2>/dev/null
}
diff --git a/shell-completion/zsh/_systemd-run b/shell-completion/zsh/_systemd-run
index ca0faa1484..22b82d66fd 100644
--- a/shell-completion/zsh/_systemd-run
+++ b/shell-completion/zsh/_systemd-run
@@ -5,7 +5,7 @@
__systemctl() {
local -a _modes
_modes=("--user" "--system")
- systemctl ${words:*_modes} --full --no-legend --no-pager "$@" 2>/dev/null
+ systemctl ${words:*_modes} --full --no-legend --no-pager --plain "$@" 2>/dev/null
}
(( $+functions[__systemd-run_get_slices] )) ||