Skip to content
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

make the man page section selectable #1227

Merged
merged 1 commit into from Jan 28, 2021

Conversation

bobuhiro11
Copy link
Contributor

What type of PR is this?

  • bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

The section number of the man page is fixed to 8.
This number can take other values depending on the usage.

https://www.man7.org/linux/man-pages/man7/man-pages.7.html

This fix adds a new argument to the ToMarkdown and ToMan methods so that they can be set to arbitrary values.
If you prefer other implementation, please let me know.

Testing

Existing test code has been reused.

Release Notes

adds a new argument to the `ToMarkdown` and `ToMan` methods so that they can be set to arbitrary section number.

@bobuhiro11 bobuhiro11 requested a review from a team as a code owner January 25, 2021 13:29
@bobuhiro11 bobuhiro11 requested review from saschagrunert and rliebz and removed request for a team January 25, 2021 13:29
Copy link
Member

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

I strongly recommend adding the 8 as a "default" for people who have an understanding of what the section number represents

@bobuhiro11
Copy link
Contributor Author

@lynncyrin I respect your opinion about the default section number.

Since Go does not support the optional argument, I would like to work on one of the following implementations.
Which one is preferable?

  • In addition to ToMan(), add a function like ToManWithSection(section int)
  • Add an attribute to the struct app to represent the section number
  • Other implementations

@coilysiren
Copy link
Member

@Nmi

In addition to ToMan(), add a function like ToManWithSection(section int)

This one sounds best!

@bobuhiro11
Copy link
Contributor Author

@lynncyrin Thanks! I've submitted a new patch.

Copy link
Member

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

Thank you ✨ can you also increase the code coverage? This page will help

https://codecov.io/gh/urfave/cli/pull/1227/diff

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
@bobuhiro11
Copy link
Contributor Author

@lynncyrin Coverage has improved. Can you please check again?

Copy link
Member

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

That's nice, LGTM 👍

@coilysiren coilysiren merged commit e1a7446 into urfave:master Jan 28, 2021
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.

None yet

3 participants