-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Change parameters order in Get-Help and help in order to get first -Full and then -Functionality when using Get-Help -Fu<tab> and help -Fu<tab>. #7370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ull and then -Functionality when using Get-Help -Fu<tab> and help -Fu<tab>.
| /// </summary> | ||
| /// <value></value> | ||
| [Parameter] | ||
| public string[] Component { get; set; } = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove initialization - null is default. Below too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| /// <summary> | ||
| /// List of Component's to search on. | ||
| /// </summary> | ||
| /// <value></value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove line /// <value></value>. Below too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| public string Parameter { set; get; } | ||
|
|
||
| /// <summary> | ||
| /// List of Component's to search on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public comment for property should start with "Gets and sets ...". Below too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
|
||
| It 'Should first suggest -Full and then -Functionalty when using Get-Help -Fu<tab>' -skip { | ||
| $res = TabExpansion2 -inputScript 'Get-Help -Fu' -cursorColumn 'Get-Help -Fu'.Length | ||
| $res.CompletionMatches[0].CompletionText | Should -Be '-Full' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use -BeExactly for strings. Below too.
| $res.CompletionMatches[1].CompletionText | Should -Be '-Functionality' | ||
| } | ||
|
|
||
| It 'Should first suggest -Full and then -Functionalty when using help -Fu<tab>' -skip { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo (missing i): Functionalty -> Functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| $res.CompletionMatches[0].CompletionText | Should -Be 'namespace' | ||
| } | ||
|
|
||
| It 'Should first suggest -Full and then -Functionalty when using Get-Help -Fu<tab>' -skip { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo (missing i): Functionalty -> Functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Please see #7371 (comment) for why I think this problem should be tackled fundamentally differently. |
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know when we will have a more general solution and so far this is LGTM.
|
@iSazonov: Understood, but my point was that the effort expended here could have gone toward fixing the problem fundamentally. |
|
@mklement0 I agree. And this is a very simple change. I think we will not be able to implement a more general solution until 6.1. So this decision will be welcome since it should not contradict a more general solution. |
|
@SteveL-MSFT Do you agree to merge the intermediate change? |
|
I'm fine taking this change as-is. @mklement0 Perhaps you can open a new issue to discuss the broader issue? |
Change parameters order in
Get-Helpcmdlet andhelpfunction in order to get first -Full and then -Functionality when usingGet-Help -Fu<tab>andhelp -Fu<tab>.Since -Full parameter is used much more frequently, than -Functionality it make sense to put it first when using tab completion.
Also, alphabetically, Full goes earlier than Functionality, that adds to the justification of the change.
Fix #7371
PR Summary
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests