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
Tab completion for command parameters shows invalid candidates #1
I can't see immediately why this happens, but here's a repro:
# this works, in that -dingtone is not shown as a candidate
set-psreadlineoption -dingtone foo -ding<tab>
# this does not work, in that it shows the parameter repeatedly as a choice
set-psreadlineoption -addtohistoryhandler foo -addtohistory<tab>
A cursory look at parameter metadata yield no clues, sorry!
As odd as it sounds, it looks like it depends whether or not there are multiple parameters with a common prefix. If there is a common prefix for more than 1 parameter, PowerShell will never suggest an already specified parameter.
If the parameter has a unique prefix, PowerShell will suggest that parameter even if it has been specified.
Try this:
functionfoo($qqq,$zzz1,$zzz2) {}
foo -qqq 1-q<TAB># will suggest -qqq
foo -zzz1 1-z<TAB># will only suggest -zzz2
foo -zzz1 1-zzz2 2-z<TAB># will suggest neither -zzz1 nor -zzz2
I asked the author of that code (no, it wasn't me) and he said it was by design, but I convinced him it was a bad design so he now considers it a bug. Maybe open a bug on Connect?
Ok, I'll just log it as it stands - I thought you were trying to justify
the behaviour as by-design too. I just presumed I was too sober to
understand and planned on drinking a few glasses of wine and reading your
mail again.
I asked the author of that code (no, it wasn't me) and he said it was by
design, but I convinced him it was a bad design so he now considers it a
bug. Maybe open a bug on Connect?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-17955905
.
Activity
oising commentedon May 13, 2013
Oh, I see that the latter - failing case - has an [AllowNullAttribute] - could that be it?
lzybkr commentedon May 13, 2013
This is a general PowerShell issue.
As odd as it sounds, it looks like it depends whether or not there are multiple parameters with a common prefix. If there is a common prefix for more than 1 parameter, PowerShell will never suggest an already specified parameter.
If the parameter has a unique prefix, PowerShell will suggest that parameter even if it has been specified.
Try this:
oising commentedon May 14, 2013
But it's a bug, right? I think you might know the guy who wrote the tab completion stuff, no? :)
lzybkr commentedon May 15, 2013
I asked the author of that code (no, it wasn't me) and he said it was by design, but I convinced him it was a bad design so he now considers it a bug. Maybe open a bug on Connect?
oising commentedon May 15, 2013
Ok, I'll just log it as it stands - I thought you were trying to justify
the behaviour as by-design too. I just presumed I was too sober to
understand and planned on drinking a few glasses of wine and reading your
mail again.
-Oisin
On Wed, May 15, 2013 at 2:10 PM, Jason Shirk notifications@github.comwrote:
404 signature missing
Merge pull request #1 from PowerShell/newDev