Skip to content

Display full help with 'help' function - #5195

Merged
Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
rkeithhill:rkeithhill/full-help-output
Nov 6, 2017
Merged

Aditya Patwardhan (adityapatwardhan) merged 4 commits into
PowerShell:masterfrom
rkeithhill:rkeithhill/full-help-output

Conversation

@rkeithhill

Copy link
Copy Markdown
Collaborator

Display full help on Windows systems where user has overriden pager with $env:PAGER.

Fix #4962

@rkeithhill

Copy link
Copy Markdown
Collaborator Author

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. :-)

@adityapatwardhan

Copy link
Copy Markdown
Member

Keith Hill (@rkeithhill) Sorry for the delay. I will review this today.

@rkeithhill

Copy link
Copy Markdown
Collaborator Author

No problem. You all had a big push to get beta.9 out.

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Collaborator Author

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.

Copy link
Copy Markdown
Collaborator Author

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
@vors
sergei (vors) removed their request for review October 28, 2017 06:03
}
}

It "help should not return full view without -Full switch" -Skip:(!$IsWindows) {

Copy link
Copy Markdown
Member

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.

https://github.com/PowerShell/PowerShell/blob/master/docs/testing-guidelines/WritingPesterTests.md#skipping-tests-in-bulk

}
}

It "help should return full view without -Full switch" -Skip:(!$IsWindows) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rkeithhill

Copy link
Copy Markdown
Collaborator Author

I think this is ready to go. The feedback from the @PowerShell/powershell-committee review was implemented in the last commit.

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) changed the title Display full help on non-Windows systems Display full help with 'help' function Nov 6, 2017
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit c781959 into PowerShell:master Nov 6, 2017
@rkeithhill
Keith Hill (rkeithhill) deleted the rkeithhill/full-help-output branch May 29, 2019 15:21
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Display full help with 'help' function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants