You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
powershell: no positional completion after a flag that takes no value #268
Going by the generated code, demo <Tab> offers directories and demo --force <Tab> offers nothing; nodeenv's CI showed the latter (see
below). The script gives --force nargs '0':
'_shtab_demo___force'='0'
When the completer meets an option string, it switches to that option and
goes on to the next token:
if ($currentOptions-and$currentOptions-contains$token) {
$currentActionKey=$prefix+'_'+ (_shtab_powershell_replace_nonword $token)
$currentActionNargs=Get-ActionNargs$currentActionKey$currentActionArgsConsumed=0$currentActionIsPositional=$falsecontinue
}
It only moves on to the next positional once the option has consumed
its arguments, and an option with nargs 0 never consumes one. Since an
empty result returns $null, PowerShell does not fall back to file names
either. The bash script handles this: after an option string matches, the
same >= nargs check runs at once and moves to the next positional.
This is from nodeenv (ekalinin/nodeenv#460), where nodeenv --force <Tab> came back empty in pwsh on the GitHub ubuntu,
macOS and Windows runners, while nodeenv -p <Tab> offered directories.
The duplicate keys of #267 had been worked around in that run.
Activity
Merge pull request tqdm#269 from mayankdhingra02/codex/fix-powershell…