-
Notifications
You must be signed in to change notification settings - Fork 582
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
Implicit value formatting #436
Comments
I think your suggested syntax does look better. I'm happy to look at a PR with the changes. I don't really want to use std::format because I want to keep supporting older versions of c++. |
Our team would prefer syntax like the following:
Handling of empty strings is also sub-par, showing up like this right now:
We would prefer the empty implicit value to be replaced with |
Sorry for late reply due to lack of time. I hastily put together the small formatting tweak ( If you wish, there is another MR with ability to specify format for each option (not a good idea, more of PoC). It can be behind CMake |
Hi, I was configuring cxxopts for new project and used some implicit values. They look a little too complex for me
with a little tweak (see below) you can have one of those
but I know it may not fit everyone.
Would you consider using
std::format
(since C++20) to allow more customization? Either per-option or at higher level.Here is the little tweak on
cxxopts.hpp
around LN2150.At the end of
format_option
is for options with implicit value formatting likebut I would like it to look like one of those
to be more in line with the one without implicit value
My personal goal is to have
<argument>
for options with required values and[argument=DEFAULT]
or[argument]=DEFAULT
.I like this library, if you like I will prepare the change as Pull Request. I just need to know whenever you like the idea and how to approach it.
The text was updated successfully, but these errors were encountered: