[systemd-devel] [PATCH 16/16] shell-comp: Split out zsh _systemd-tmpfiles

William Giokas 1007380 at gmail.com
Tue Jul 30 21:22:54 PDT 2013


You can choose to have systemd-tmpfiles at configuration time, so only
install the completion for this if configured to do so.
---
 Makefile.am                            |  3 +++
 shell-completion/zsh/_systemd          | 12 +-----------
 shell-completion/zsh/_systemd-tmpfiles | 10 ++++++++++
 3 files changed, 14 insertions(+), 11 deletions(-)
 create mode 100644 shell-completion/zsh/_systemd-tmpfiles

diff --git a/Makefile.am b/Makefile.am
index 3713d0d..e35eaeb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1565,6 +1565,9 @@ SYSINIT_TARGET_WANTS += \
 	systemd-tmpfiles-setup-dev.service \
 	systemd-tmpfiles-setup.service
 
+dist_zshcompletion_DATA += \
+	shell-completion/zsh/_systemd-tmpfiles
+
 TIMERS_TARGET_WANTS += \
 	systemd-tmpfiles-clean.timer
 
diff --git a/shell-completion/zsh/_systemd b/shell-completion/zsh/_systemd
index 1addfa5..7aab52d 100644
--- a/shell-completion/zsh/_systemd
+++ b/shell-completion/zsh/_systemd
@@ -1,4 +1,4 @@
-#compdef systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-machine-id-setup systemd-notify systemd-tmpfiles systemd-tty-ask-password-agent
+#compdef systemd-cat systemd-ask-password systemd-cgls systemd-cgtop systemd-delta systemd-detect-virt systemd-machine-id-setup systemd-notify systemd-tty-ask-password-agent
 
 _ctls()
 {
@@ -77,16 +77,6 @@ _ctls()
                 '--booted[Returns 0 if the system was booted up with systemd]' \
                 '--readahead=[Controls disk read-ahead operations]:arguments:(cancel done noreply)'
         ;;
-        systemd-tmpfiles)
-            _arguments \
-                '--create[Create, set ownership/permissions based on the config files.]' \
-                '--clean[Clean up all files and directories with an age parameter configured.]' \
-                '--remove[All files and directories marked with r, R in the configuration files are removed.]' \
-                '--prefix=[Only apply rules that apply to paths with the specified prefix.]' \
-                '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \
-                '--help[Prints a short help text and exits.]' \
-                '*::files:_files'
-        ;;
         systemd-tty-ask-password-agent)
             _arguments \
                 {-h,--help}'[Prints a short help text and exits.]' \
diff --git a/shell-completion/zsh/_systemd-tmpfiles b/shell-completion/zsh/_systemd-tmpfiles
new file mode 100644
index 0000000..4913ded
--- /dev/null
+++ b/shell-completion/zsh/_systemd-tmpfiles
@@ -0,0 +1,10 @@
+#compdef systemd-tmpfiles
+
+_arguments \
+    '--create[Create, set ownership/permissions based on the config files.]' \
+    '--clean[Clean up all files and directories with an age parameter configured.]' \
+    '--remove[All files and directories marked with r, R in the configuration files are removed.]' \
+    '--prefix=[Only apply rules that apply to paths with the specified prefix.]' \
+    '--exclude-prefix=[Ignore rules that apply to paths with the specified prefix.]' \
+    '--help[Prints a short help text and exits.]' \
+    '*::files:_files'
-- 
1.8.4.rc0.352.g531e8cb



More information about the systemd-devel mailing list