diff options
| author | Clément Joly <oss@131719.xyz> | 2020-06-20 18:01:13 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2020-06-26 11:28:33 +0200 |
| commit | 2d4aea4e2180058ad4bf9fcd3103be2f0fc363ca (patch) | |
| tree | 9ecda02e4e6ab40f3dccf219e6f0d830df0f0273 | |
| parent | a54e05de9c40537dd2f8b67d8edd0baebc83df6b (diff) | |
| download | mullvadvpn-2d4aea4e2180058ad4bf9fcd3103be2f0fc363ca.tar.xz mullvadvpn-2d4aea4e2180058ad4bf9fcd3103be2f0fc363ca.zip | |
Add fish shell completions
Generate fish shell completions at build time. Empower fish users with
completions.
Completions are copied in the [recommended directory](https://fishshell.com/docs/current/#where-to-put-completions)
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rwxr-xr-x | build.sh | 2 | ||||
| -rwxr-xr-x | dist-assets/pkg-scripts/postinstall | 2 | ||||
| -rw-r--r-- | gui/tasks/distribution.js | 2 |
4 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cd6518c8e4..f816de81fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Line wrap the file at 100 chars. Th ## [Unreleased] ### Added - Show system notification when account has expired. +- Add fish shell completions for the mullvad CLI. ### Changed - Upgrade from Electron 7 to Electron 8. @@ -138,7 +138,7 @@ echo "Building Rust code in release mode using $RUSTC_VERSION..." if [[ ("$(uname -s)" == "Darwin") || ("$(uname -s)" == "Linux") ]]; then pushd mullvad-cli mkdir -p "$SCRIPT_DIR/dist-assets/shell-completions" - for sh in bash zsh; do + for sh in bash zsh fish; do echo "Generating shell completion script for $sh..." cargo +stable run $CARGO_ARGS --release --features shell-completions -- \ shell-completions "$sh" "$SCRIPT_DIR/dist-assets/shell-completions/" diff --git a/dist-assets/pkg-scripts/postinstall b/dist-assets/pkg-scripts/postinstall index 803e9cf276..9e6db15a6f 100755 --- a/dist-assets/pkg-scripts/postinstall +++ b/dist-assets/pkg-scripts/postinstall @@ -63,5 +63,7 @@ mkdir -p /usr/local/bin ln -sf "$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/mullvad" /usr/local/bin/mullvad ln -sf "$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/mullvad-problem-report" /usr/local/bin/mullvad-problem-report +ln -sf "$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/mullvad.fish" /usr/share/fish/vendor_completions.d + mkdir -p "$ZSH_COMPLETIONS_DIR" ln -sf "$INSTALL_DIR/Mullvad VPN.app/Contents/Resources/_mullvad" "$ZSH_COMPLETIONS_DIR/_mullvad" diff --git a/gui/tasks/distribution.js b/gui/tasks/distribution.js index c0fc5ecb09..a84102c6bf 100644 --- a/gui/tasks/distribution.js +++ b/gui/tasks/distribution.js @@ -131,6 +131,7 @@ const config = { distAssets('shell-completions/mullvad.bash') + '=/usr/share/bash-completion/completions/mullvad', distAssets('shell-completions/_mullvad') + '=/usr/local/share/zsh/site-functions/_mullvad', + distAssets('shell-completions/mullvad.fish') + '=/usr/share/fish/vendor_completions.d', ], afterInstall: distAssets('linux/after-install.sh'), afterRemove: distAssets('linux/after-remove.sh'), @@ -155,6 +156,7 @@ const config = { distAssets('shell-completions/mullvad.bash') + '=/usr/share/bash-completion/completions/mullvad', distAssets('shell-completions/_mullvad') + '=/usr/share/zsh/site-functions/_mullvad', + distAssets('shell-completions/mullvad.fish') + '=/usr/share/fish/vendor_completions.d', ], afterInstall: distAssets('linux/after-install.sh'), afterRemove: distAssets('linux/after-remove.sh'), |
