summary refs log tree commit diff
path: root/gnu/packages/rust-apps.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/rust-apps.scm')
-rw-r--r--gnu/packages/rust-apps.scm23
1 files changed, 22 insertions, 1 deletions
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 7a5760a396..894173b7dd 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -806,7 +806,28 @@ bar.  It is also compatible with sway.")
            (lambda* (#:key outputs #:allow-other-keys)
              (install-file "man/just.1"
                            (string-append (assoc-ref outputs "out")
-                                          "/share/man/man1")))))))
+                                          "/share/man/man1"))))
+         (add-after 'install 'install-completions
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share"))
+                    (just (string-append out "/bin/just")))
+               (mkdir-p (string-append share "/bash-completion/completions"))
+               (with-output-to-file
+                 (string-append share "/bash-completion/completions/just")
+                 (lambda _ (invoke just "--completions" "bash")))
+               (mkdir-p (string-append share "/fish/vendor_completions.d"))
+               (with-output-to-file
+                 (string-append share "/fish/vendor_completions.d/just.fish")
+                 (lambda _ (invoke just "--completions" "fish")))
+               (mkdir-p (string-append share "/zsh/site-functions"))
+               (with-output-to-file
+                 (string-append share "/zsh/site-functions/_just")
+                 (lambda _ (invoke just "--completions" "zsh")))
+               (mkdir-p (string-append share "/elvish/lib"))
+               (with-output-to-file
+                 (string-append share "/elvish/lib/just")
+                 (lambda _ (invoke just "--completions" "elvish")))))))))
     (home-page "https://github.com/casey/just")
     (synopsis "Just a command runner")
     (description "This package provides @code{just}, a command runner.