From 84cf485b31541f054ac5159cc9d7af1b072bea95 Mon Sep 17 00:00:00 2001 From: Reinier Criel Date: Wed, 5 Nov 2025 16:24:57 -0800 Subject: [PATCH] Add comment explaining forwarding --- .../templates/windows-python-wrapper.template.cmd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/safe-chain/src/shell-integration/path-wrappers/templates/windows-python-wrapper.template.cmd b/packages/safe-chain/src/shell-integration/path-wrappers/templates/windows-python-wrapper.template.cmd index 5b4ddd9..2974ee5 100644 --- a/packages/safe-chain/src/shell-integration/path-wrappers/templates/windows-python-wrapper.template.cmd +++ b/packages/safe-chain/src/shell-integration/path-wrappers/templates/windows-python-wrapper.template.cmd @@ -20,12 +20,18 @@ goto FALLBACK :CALL_PIP3 shift shift -set "PATH=%CLEAN_PATH%" & aikido-pip3 %1 %2 %3 %4 %5 %6 %7 %8 %9 +REM Note on argument forwarding: +REM - We cannot use %* here because SHIFT does not update %* (it still contains the original argv). +REM - CMD only exposes nine positional parameters at a time: %1 .. %9. %10 is parsed as %1 followed by '0'. +\set "PATH=%CLEAN_PATH%" & aikido-pip3 %1 %2 %3 %4 %5 %6 %7 %8 %9 goto :eof :CALL_PIP shift shift +REM Note on argument forwarding: +REM - We cannot use %* here because SHIFT does not update %* (it still contains the original argv). +REM - CMD only exposes nine positional parameters at a time: %1 .. %9. %10 is parsed as %1 followed by '0'. if /I "%INVOKED%"=="python3" ( set "PATH=%CLEAN_PATH%" & aikido-pip3 %1 %2 %3 %4 %5 %6 %7 %8 %9 ) else (