|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From 49323e421a0fad064e3258ca26ae8c80a3386666 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Date: Mon, 14 Jul 2014 19:24:46 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Subject: [PATCH] shell-completion: restore completion for -p
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
It was broken since systemd was moved out of /bin.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
For zsh it was never there.
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
(cherry picked from commit c0a67aef31bb9716617ffe150ca8be19c5df203e)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
Makefile.am | 19 +++++++++++++++++--
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/.gitignore | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/{systemctl => systemctl.in} | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/.gitignore | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/{_systemctl => _systemctl.in} | 15 ++++++++++++++-
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
5 files changed, 35 insertions(+), 5 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
create mode 100644 shell-completion/bash/.gitignore
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
rename shell-completion/bash/{systemctl => systemctl.in} (98%)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
create mode 100644 shell-completion/zsh/.gitignore
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
rename shell-completion/zsh/{_systemctl => _systemctl.in} (95%)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/Makefile.am b/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 025461b497..9847ff50bc 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -383,7 +383,6 @@ systemgenerator_PROGRAMS = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
dist_bashcompletion_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/busctl \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/journalctl \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- shell-completion/bash/systemctl \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/systemd-analyze \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/systemd-cat \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/systemd-cgls \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -395,8 +394,10 @@ dist_bashcompletion_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/udevadm \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/bash/kernel-install
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+nodist_bashcompletion_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
dist_zshcompletion_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- shell-completion/zsh/_systemctl \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/_journalctl \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/_udevadm \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/_kernel-install \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -407,6 +408,17 @@ dist_zshcompletion_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/_systemd-delta \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
shell-completion/zsh/_systemd
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+nodist_zshcompletion_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ shell-completion/zsh/_systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+EXTRA_DIST += \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ shell-completion/bash/systemctl.in \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ shell-completion/zsh/_systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+CLEANFILES += \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ $(nodist_bashcompletion_DATA) \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ $(nodist_zshcompletion_DATA)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
dist_sysctl_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
sysctl.d/50-default.conf
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -5196,6 +5208,9 @@ src/core/macros.%: src/core/macros.%.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
src/%.policy.in: src/%.policy.in.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
$(SED_PROCESS)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+shell-completion/%: shell-completion/%.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ $(SED_PROCESS)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
%.rules: %.rules.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
$(SED_PROCESS)
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/shell-completion/bash/.gitignore b/shell-completion/bash/.gitignore
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
new file mode 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 0000000000..016e09d1e7
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- /dev/null
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/shell-completion/bash/.gitignore
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -0,0 +1 @@
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/shell-completion/bash/systemctl b/shell-completion/bash/systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
similarity index 98%
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
rename from shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
rename to shell-completion/bash/systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index e1c842006e..4beec4e13f 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/shell-completion/bash/systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/shell-completion/bash/systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -24,8 +24,8 @@ __systemctl() {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
__systemd_properties() {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
local mode=$1
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- { __systemctl -a $mode show;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- systemd --dump-configuration-items; } |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ { __systemctl $mode show --all;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ @rootlibexecdir@/systemd --dump-configuration-items; } |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
while IFS='=' read -r key value; do
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
[[ $value ]] && echo "$key"
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
done
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/shell-completion/zsh/.gitignore b/shell-completion/zsh/.gitignore
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
new file mode 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index 0000000000..75f13ad6d1
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- /dev/null
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/shell-completion/zsh/.gitignore
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -0,0 +1 @@
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+/_systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
diff --git a/shell-completion/zsh/_systemctl b/shell-completion/zsh/_systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
similarity index 95%
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
rename from shell-completion/zsh/_systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
rename to shell-completion/zsh/_systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
index b6cf664587..d9b8d1c0e3 100644
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
--- a/shell-completion/zsh/_systemctl
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+++ b/shell-completion/zsh/_systemctl.in
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
@@ -301,12 +301,25 @@ _unit_types() {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
_values -s , "${_types[@]}"
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+_unit_properties() {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES ) &&
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ ! _retrieve_cache SYS_ALL_PROPERTIES;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ then
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ _sys_all_properties=( $( {__systemctl show --all;
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ @rootlibexecdir@/systemd --dump-configuration-items; } | {
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ while IFS='=' read -r a b; do [ -n "$b" ] && echo "$a"; done
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ }) )
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ _store_cache SYS_ALL_PROPRTIES _sys_all_properties
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ fi
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ _values -s , "${_sys_all_properties[@]}"
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+}
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
_arguments -s \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
{-h,--help}'[Show help]' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
'--version[Show package version]' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
{-t+,--type=}'[List only units of a particular type]:unit type:_unit_types' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
'--state=[Display units in the specifyied state]:unit state:_unit_states' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
- \*{-p+,--property=}'[Show only properties by specific name]:unit property' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
+ {-p+,--property=}'[Show only properties by specific name]:unit property:_unit_properties' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
{-a,--all}'[Show all units/properties, including dead/empty ones]' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
'--reverse[Show reverse dependencies]' \
|
|
Zbigniew Jędrzejewski-Szmek |
43ff24 |
'--after[Show units ordered after]' \
|