@@ -449,6 +449,13 @@ if [ -n "$BASH_VERSION" ] && type complete >/dev/null 2>&1; then
449449 eval "$(VP_COMPLETE=bash command vp)"
450450elif [ -n "$ZSH_VERSION" ] && type compdef >/dev/null 2>&1; then
451451 eval "$(VP_COMPLETE=zsh command vp)"
452+ _vpr_complete() {
453+ local -a orig=("${words[@]}")
454+ words=("vp" "run" "${orig[@]:1}")
455+ CURRENT=$((CURRENT + 1))
456+ ${=_comps[vp]}
457+ }
458+ compdef _vpr_complete vpr
452459fi
453460"#
454461 . replace ( "__VP_BIN__" , & bin_path_ref) ;
478485
479486# Dynamic shell completion for fish
480487VP_COMPLETE=fish command vp | source
488+
489+ function __vpr_complete
490+ set -l tokens (commandline --current-process --tokenize --cut-at-cursor)
491+ set -l current (commandline --current-token)
492+ VP_COMPLETE=fish command vp -- vp run $tokens[2..] $current
493+ end
494+ complete -c vpr --keep-order --exclusive --arguments "(__vpr_complete)"
481495"#
482496 . replace ( "__VP_BIN__" , & bin_path_ref) ;
483497 let env_fish_file = vite_plus_home. join ( "env.fish" ) ;
@@ -518,6 +532,27 @@ function vp {
518532$env:VP_COMPLETE = "powershell"
519533& (Join-Path $__vp_bin "vp.exe") | Out-String | Invoke-Expression
520534Remove-Item Env:\VP_COMPLETE -ErrorAction SilentlyContinue
535+
536+ $__vpr_comp = {
537+ param($wordToComplete, $commandAst, $cursorPosition)
538+ $prev = $env:VP_COMPLETE
539+ $env:VP_COMPLETE = "powershell"
540+ $commandLine = $commandAst.Extent.Text
541+ $args = $commandLine.Substring(0, [math]::Min($cursorPosition, $commandLine.Length))
542+ $args = $args -replace '^(vpr\.exe|vpr)\b', 'vp run'
543+ if ($wordToComplete -eq "") { $args += " ''" }
544+ $results = Invoke-Expression @"
545+ & (Join-Path $__vp_bin 'vp.exe') -- $args
546+ "@;
547+ if ($prev) { $env:VP_COMPLETE = $prev } else { Remove-Item Env:\VP_COMPLETE }
548+ $results | ForEach-Object {
549+ $split = $_.Split("`t")
550+ $cmd = $split[0];
551+ if ($split.Length -eq 2) { $help = $split[1] } else { $help = $split[0] }
552+ [System.Management.Automation.CompletionResult]::new($cmd, $cmd, 'ParameterValue', $help)
553+ }
554+ }
555+ Register-ArgumentCompleter -Native -CommandName vpr -ScriptBlock $__vpr_comp
521556"# ;
522557
523558 // For PowerShell, use the actual absolute path (not $HOME-relative)
0 commit comments