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

Paginate the CONFIG command's output #3758

Merged
merged 13 commits into from
Jun 15, 2024
Merged

Conversation

johnnovak
Copy link
Member

@johnnovak johnnovak commented Jun 11, 2024

Description

As the title says. Displaying our built-in command's help with the /? or -h options does that already, so I've taught CONFIG the same trick.

It really bothered me that I had to make people type in things like CONFIG -h glshader | MORE in the getting started guide. Plus having to pipe things through MORE manually is just an annoyance for everybody.

I've also some made some further enhancements to the output (inserting some new lines here and there).

This fixes the PVS-Studio warnings too that I somehow introduced to main...

Manual testing

Played around with the relevant CONFIG commands, and confirmed the output is now paginated.

Checklist

Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.

I have:

  • followed the project's contributing guidelines and code of conduct.
  • performed a self-review of my code.
  • commented on the particularly hard-to-understand areas of my code.
  • split my work into well-defined, bisectable commits, and I named my commits well.
  • applied the appropriate labels (bug, enhancement, refactoring, documentation, etc.)
  • checked that all my commits can be built.
  • confirmed that my code does not cause performance regressions (e.g., by running the Quake benchmark).
  • added unit tests where applicable to prove the correctness of my code and to avoid future regressions.
  • made corresponding changes to the documentation or the website according to the documentation guidelines.
  • locally verified my website or documentation changes.

@johnnovak johnnovak changed the base branch from main to jn/config-improvements June 11, 2024 08:43
@johnnovak johnnovak self-assigned this Jun 11, 2024
@johnnovak johnnovak added documentation Improvements or additions to documentation enhancement New feature or enhancement of existing features labels Jun 11, 2024
@johnnovak johnnovak force-pushed the jn/paginate-config-output branch 3 times, most recently from f05e682 to 7c597a6 Compare June 11, 2024 09:42
@johnnovak johnnovak force-pushed the jn/paginate-config-output branch 2 times, most recently from 7c9cb31 to 0a03dab Compare June 14, 2024 03:21
@johnnovak johnnovak changed the base branch from jn/config-improvements to main June 14, 2024 04:31
@johnnovak johnnovak marked this pull request as ready for review June 14, 2024 08:43
@FeralChild64
Copy link
Collaborator

Most likely the https://github.com/dosbox-staging/dosbox-staging/blob/jn/paginate-config-output/contrib/resources/translations/README.md file needs a small update. It claims:

Do not exceed 79 characters on a line, or commands such as config -h fullscreen won't be able to display the help properly, and might wrap the text or display blank lines. The limit might be increased to 80 characters in the future, but the implementation is not there yet.

If I understand correctly, the implementation is now done (but I won't have time to test it today).

@FeralChild64
Copy link
Collaborator

Another general remark - I fully understand if you consider it out of scope of this PR, but it would be nice to also fix the wrap-around problem I have marked on the screenshot. ideally, the second line with possible values should be indented:

Example

@johnnovak
Copy link
Member Author

Thanks @FeralChild64, I'll take care of these two issues you mentioned in this PR. They seem simple enough.

@johnnovak
Copy link
Member Author

johnnovak commented Jun 15, 2024

@FeralChild64 80 char long lines are fine now, so I've updated the translation guide.

Only the machine setting has a long list of enum values, nothing else is affected. Frankly, I can't be bothered with that today. I've burned 20 minutes on it, but still not even halfway done, so I'm aborting it...

Raised a ticket for it: #3769

@FeralChild64
Copy link
Collaborator

That's perfectly fine - this is a minor issue, and not a regression.

src/misc/programs.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@weirddan455 weirddan455 left a comment

Choose a reason for hiding this comment

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

This all looks good to me.

@johnnovak johnnovak merged commit 2ed2c53 into main Jun 15, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or enhancement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants