From d32832ec752e9b894cd545fa468cebcaaf3ebb43 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 20 Jun 2026 23:53:00 +0000 Subject: [PATCH] wolf: add tab-completion + clarify fix-ea-game is universal for EA titles - install-completion: writes a bash completion script to ~/.bash_completion.d/manage-wolf and registers it, so double-tab after './manage.sh ' shows all available commands. - fix-ea-game kept as general name (not fix-swbf2-2017): the EA Desktop registry key is shared across all EA games; the Valve has-run key follows the same EADesktopSetup pattern across EA's catalog. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs --- services/wolf.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/services/wolf.sh b/services/wolf.sh index e9605dc..6d2cbc7 100644 --- a/services/wolf.sh +++ b/services/wolf.sh @@ -1655,6 +1655,31 @@ PYEOF [ "$found" = 0 ] && echo " Nothing to fix (no Wolf state dir found yet)." echo "Done. Reconnect from Moonlight to relaunch the app." ;; + install-completion) + # Install bash tab-completion for this manage.sh so that double-tab + # after './manage.sh ' shows all available commands. Works for any + # user whose shell sources ~/.bash_completion.d/ (most modern setups + # do; Ubuntu 22.04+ sources it automatically via /etc/bash.bashrc). + COMP_DIR="$HOME/.bash_completion.d" + COMP_FILE="$COMP_DIR/manage-wolf" + mkdir -p "$COMP_DIR" + cat > "$COMP_FILE" << 'COMPEOF' +_manage_wolf_complete() { + local cur="${COMP_WORDS[COMP_CWORD]}" + local commands="start stop restart logs status pin update apps reorder + add-web ge-proton games fix-ea-game fix-perms + install-completion backup" + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) +} +# Register for any script named manage.sh regardless of path +complete -F _manage_wolf_complete manage.sh +COMPEOF + # Also source it immediately in the current shell if possible + echo "source \"$COMP_FILE\"" >> "$HOME/.bash_completion" 2>/dev/null || true + echo "Bash completion installed → $COMP_FILE" + echo "Open a new terminal (or run: source \"$COMP_FILE\"), then:" + echo " ./manage.sh shows all commands" + ;; pin) # Wolf logs: "Insert pin at http://SOMEIP:47989/pin/#HEXHASH" # Extract just the hash fragment and build URLs for every interface @@ -1700,6 +1725,7 @@ PYEOF echo " ./manage.sh games - List installed games + their AppIDs" echo " ./manage.sh fix-ea-game [appid] - Unstick EA App install loop (default: SWBF2 1237950)" echo " ./manage.sh fix-perms - Fix 'Permission denied' app startup errors" + echo " ./manage.sh install-completion - Enable tab-completion for this script" echo " ./manage.sh backup - How to set up backups" ;; esac