From 857f2ec5ac48b4cfedf13d945846dc60877bcd15 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 19 Jan 2024 19:49:58 +0000 Subject: [PATCH] rage: Install Elvish completions in Debian package These are not automatically discovered, but installing the files means that Elvish users can import them. --- rage/CHANGELOG.md | 2 ++ rage/Cargo.toml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/rage/CHANGELOG.md b/rage/CHANGELOG.md index c6ae5967..be4fa163 100644 --- a/rage/CHANGELOG.md +++ b/rage/CHANGELOG.md @@ -11,6 +11,8 @@ to 1.0.0 are beta releases. ## [Unreleased] ### Added - `rage-keygen -y IDENTITY_FILE` to convert identity files to recipients. +- Elvish completions to the Debian package. These are not automatically + discovered; Elvish users will need to manually import them. ### Changed - MSRV is now 1.65.0. diff --git a/rage/Cargo.toml b/rage/Cargo.toml index 8f01ab08..f67f2171 100644 --- a/rage/Cargo.toml +++ b/rage/Cargo.toml @@ -38,6 +38,24 @@ assets = [ ["target/release/completions/rage-keygen.bash", "usr/share/bash-completion/completions/rage-keygen", "644"], ["target/release/completions/rage-mount.bash", "usr/share/bash-completion/completions/rage-mount", "644"], + # From https://github.com/elves/elvish/issues/1564#issuecomment-1166333636: + # > Completion files can be installed like other modules into a global module search + # > directory ([..]). There is no automatic discovery of completion files though; the + # > user would have to import them manually with `use`. + # + # From https://elv.sh/ref/command.html#module-search-directories: + # > When importing modules, Elvish searches the following directories: + # > [..] + # > 3. If the XDG_DATA_DIRS environment variable is defined and non-empty, it is + # > treated as a colon-delimited list of paths (semicolon-delimited on Windows), + # > which are all searched. + # > + # > Otherwise, `/usr/local/share/elvish/lib` and `/usr/share/elvish/lib` are + # > searched on non-Windows OSes. + ["target/release/completions/rage.elv", "usr/share/elvish/lib/", "644"], + ["target/release/completions/rage-keygen.elv", "usr/share/elvish/lib/", "644"], + ["target/release/completions/rage-mount.elv", "usr/share/elvish/lib/", "644"], + # From https://fishshell.com/docs/current/completions.html#where-to-put-completions: # > By default, Fish searches the following for completions, using the first available # > file that it finds: