From 1059d878476c231f84ef9d3c2e8bcafaf978bc87 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 13 May 2026 11:27:16 +0200 Subject: Regenerate shell completions and install script fixes - Add hidden completions subcommand to CLI (developer use only) - Regenerate all completion scripts from current CLI structure - Add elvish and powershell completion scripts - install.sh: Fix rsp stop -> rsp stop-daemon, rsp start -> rsp start-daemon - install.sh: Install completions for user's current shell - install.sh: Zsh uses /usr/share/zsh/site-functions/_rsp directly --- install.sh | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 5a1e888..a7317e9 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ cargo build --release echo "Stopping existing daemon..." systemctl --user stop rsplayer 2>/dev/null || true -rsp stop 2>/dev/null || true +rsp stop-daemon 2>/dev/null || true echo "Installing to /usr/bin/rsp..." sudo cp target/release/rsp /usr/bin/rsp @@ -26,4 +26,40 @@ else fi echo "" -echo "Done! Run 'rsp start' to start the daemon." +echo "Installing shell completions..." +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +shell_name=$(basename "${SHELL:-}") +case "$shell_name" in + bash) + dest="${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions" + mkdir -p "$dest" + cp "$SCRIPT_DIR/completions/rsp.bash" "$dest/rsp" + echo " → Bash completions: $dest/rsp" + ;; + zsh) + dest="/usr/share/zsh/site-functions/_rsp" + sudo cp "$SCRIPT_DIR/completions/rsp.zsh" "$dest" + echo " → Zsh completions: $dest" + ;; + fish) + dest="$HOME/.config/fish/completions/rsp.fish" + mkdir -p "$(dirname "$dest")" + cp "$SCRIPT_DIR/completions/rsp.fish" "$dest" + echo " → Fish completions: $dest" + ;; + elvish) + dest="$HOME/.config/elvish/rc.d/rsp.elvish" + mkdir -p "$(dirname "$dest")" + cp "$SCRIPT_DIR/completions/rsp.elvish" "$dest" + echo " → Elvish completions: $dest" + ;; + powershell) + echo " → PowerShell: source \"$SCRIPT_DIR/completions/rsp.powershell\" from your profile" + ;; + *) + echo " → Unrecognized shell '$shell_name'; completion files are in $SCRIPT_DIR/completions/" + ;; +esac + +echo "" +echo "Done! Run 'rsp start-daemon' to start the daemon." -- cgit v1.2.3