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

Printing help text without ostream #50

Closed
vadz opened this issue Apr 5, 2021 · 2 comments
Closed

Printing help text without ostream #50

vadz opened this issue Apr 5, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@vadz
Copy link

vadz commented Apr 5, 2021

It would be nice if it were possible to print the help text without passing by std::ostream, e.g. I'm migrating existing code to fmt, but still have to use either std::cerr or std::ostrstream to be able to print help message and I'd rather avoid it.

The simplest fix would seem to be to refactor parser::print_help_text() to use get_help_text() returning a std::string, as this function doesn't really use any of the streams functionality and does formatting manually anyhow. As usual, I could make a PR if this could be useful -- please let me know.

Note that while this is somewhat related to #46, but not really the same thing.

@grafikrobot grafikrobot added the enhancement New feature or request label Apr 6, 2021
@grafikrobot grafikrobot self-assigned this Apr 3, 2023
@grafikrobot grafikrobot moved this to 🆕 New in BFG Tasks Apr 8, 2023
@jjulianoatnv
Copy link

I would benefit. I've been taking the default help text and passing it through a "transformation filter" that modifies the formatting into a structure that the default help text cannot emit. The need to go through an iostream is an annoyance. The proposed change would simplify my post-processing.

@grafikrobot grafikrobot moved this from 🆕 New to 🏗 In progress in BFG Tasks Apr 16, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in BFG Tasks Apr 19, 2023
@jjulianoatnv
Copy link

Nice. 772e1f0 looks good, and I believe it will help to improve my use case that I mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants