-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Display full help with 'help' function #5195
Display full help with 'help' function #5195
Conversation
Any chance of something like this making it in before 6.0.0 final? It would be nice to offer full help to Linux users. And to Windows users who elect to set $env:PAGER to a better pager app. :-) |
@rkeithhill Sorry for the delay. I will review this today. |
No problem. You all had a big push to get beta.9 out. |
# On Windows, only display the full help topic if the user has specified a PAGER app. | ||
if (($psCmdlet.ParameterSetName -eq 'AllUsersView') -and !$Full -and (!$IsWindows -or (Test-Path env:PAGER))) { | ||
$PSBoundParameters['Full'] = $true | ||
} |
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.
Can we add a test which check the view that gets selected. It should have #FullView
(Get-Help Get-Command -Full).psobject.typenames
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.
Yes, I can add that.
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.
BTW, to be clear, this tweak affects only the help
function on Linux/macOS/Windows as well as the man
alias on Windows. That function pipes through a pager so we don't get rich objects out - just text. That is why I'm using -cmatch
to look for certain words that indicate it is full help.
Display full help on Windows systems where user has overriden pager with $env:PAGER. Fix PowerShell#4962
c18eb53
to
1eb85f2
Compare
} | ||
} | ||
|
||
It "help should not return full view without -Full switch" -Skip:(!$IsWindows) { |
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.
Since you already have and after all the Skip
should be done over there instead of repeating it in every It
.
} | ||
} | ||
|
||
It "help should return full view without -Full switch" -Skip:(!$IsWindows) { |
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.
Same comment as above.
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.
LGTM
As per PowerShell Committee discussion - PowerShell#4962 (comment)
I think this is ready to go. The feedback from the @PowerShell/powershell-committee review was implemented in the last commit. |
Display full help on Windows systems where user has overriden pager with $env:PAGER.
Fix #4962