chiark / gitweb /
zsh_completion: Split out zsh _systemd-tmpfiles
authorWilliam Giokas <1007380@gmail.com>
Wed, 31 Jul 2013 00:05:31 +0000 (19:05 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 2 Aug 2013 14:44:14 +0000 (10:44 -0400)
You can choose to have systemd-tmpfiles at configuration time, so only
install the completion for this if configured to do so.

Makefile.am
shell-completion/zsh/_systemd
shell-completion/zsh/_systemd-tmpfiles [new file with mode: 0644]

index 3713d0dd60e0435803816dc1cbc60ede240d7afe..e35eaeb73d961ce432f433c42129d4a5d7a826e1 100644 (file)
@@ -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
 
index 1addfa5878463bd91fb34cecf60c91257c3f1553..7aab52d5b65c7a2931801ca25bbcb83e92f1265b 100644 (file)
@@ -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 (file)
index 0000000..4913ded
--- /dev/null
@@ -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'