-
Notifications
You must be signed in to change notification settings - Fork 9
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
Format man page #102
Format man page #102
Conversation
8489242
to
2811aae
Compare
/packit build |
2811aae
to
dde0023
Compare
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.
It's a great improvement.
But, the generated man page has some problems with formatting of command line options. For example it shows d, --debug
instead of -d, --debug
. Also, the FILE
positional argument isn't visible.
openscap_report/cli.py
Outdated
"LOG LEVELS:\n" | ||
"\tDEBUG - Detailed information, typically of interest only for diagnosing problems.\n" | ||
"\tINFO - A confirmation that things are working as expected.\n" | ||
"\nLOG LEVELS:\n" |
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.
For these types of strings where you want to preserve whitespace etc. a triple-quoted string """ ... """
could work better.
openscap_report/cli.py
Outdated
"\tWARING - An indication that something unexpected happened, or a signal of" | ||
" a possible problem in the future. The software is still working as expected.\n" | ||
" a possible problem in the future. The software is still working as expected.\n\n" |
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.
WARNING
openscap_report/cli.py
Outdated
@@ -85,7 +101,7 @@ def prepare_parser(): | |||
default="WARNING", | |||
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], | |||
help=( | |||
"write debug information to the log up to the LOG_LEVEL." | |||
"write debug information to the log up to the LOG_LEVEL. (default: %(default)s)" |
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.
This default section causes that there is the default described twice in the man page.
openscap_report/cli.py
Outdated
else: | ||
default = action.dest.upper() | ||
args_string = self._format_args(action, default) | ||
parts.append(f'{", ".join(action.option_strings)} {args_string}') |
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.
There is too much braces and quotes on this line, which makes it harder to read. I think it would be more readable if the ", ".join(action.option_strings)
part would be extracted to a variable.
dde0023
to
57035a4
Compare
Hello @Honny1! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-08-31 12:57:44 UTC |
57035a4
to
4eb9493
Compare
@Honny1 What has changed? Have you addressed the feedback? |
@jan-cerny Yes, I have addressed the feedback. I am currently trying to replicate the problem you described in the first place. But I can't reproduce the problem. |
@jan-cerny I have successfully reproduced the problem with the formatting of command line options. It looks like this is caused by some bug in the old version of the |
@jan-cerny I found the main cause of the problem with the formatting of command line options. In generated man page are missed white spaces before the parameter texts. That's why Here is part of the diff in the man pages generated by the different versions of the packages:
I am currently working on a fix. |
In generated man page are missed white spaces before the parameter texts. That's why man does not show the first dash or FILE text.
4eb9493
to
3deb206
Compare
@jan-cerny The fix is uploaded. You can test it. |
Yes, it could be caused by the version. I'm using python3-sphinx-4.1.2-3.fc35.noarch. But, your fix didn't help, I still have the issue with missing dashes in options in the generated man page. It still generates lines like |
@jan-cerny How did you generate a man page? The default behaviour of |
@Honny1 Great! That was it! I was simply expecting that it overwrites existing files. If I do some cleaning and remove them before, it works fine. |
This PR improves the format of the man page.