Closed vadz closed 1 year ago
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.
Nice. https://github.com/bfgroup/Lyra/commit/772e1f039030c0bcbc5b8898f77009812e3b956f looks good, and I believe it will help to improve my use case that I mentioned above.
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 tofmt
, but still have to use eitherstd::cerr
orstd::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 useget_help_text()
returning astd::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.