-
Notifications
You must be signed in to change notification settings - Fork 350
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
Allow non standard option names like -option
#1078
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1078 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 17 17
Lines 4546 4971 +425
Branches 0 1022 +1022
===========================================
+ Hits 4546 4971 +425 ☔ View full report in Codecov by Sentry. |
@henryiii Been thinking about this one for a while. played with a bunch of different options for this, still not sure how I feel about it, but I do see the point that if CLI11 is to be a replacement in some legacy applications, we do need some mechanic to support single dash long options. This way seems like the least intrusive and least complex on the option side. Not going to merge this until you approve though. |
@@ -22,7 +22,7 @@ jobs: | |||
- job: CppLint | |||
pool: | |||
vmImage: "ubuntu-latest" | |||
container: sharaku/cpplint:latest | |||
container: helics/buildenv:cpplint |
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.
the container we had been using hasn't been updated in 5 years. Figured we needed something a little newer.
@@ -9,6 +9,7 @@ | |||
#include <CLI/CLI.hpp> | |||
#include <iostream> | |||
#include <sstream> | |||
#include <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.
Why are these adding string with no changes? IWYU?
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.
the update to cpplint includes a lot more IWYU checks so this came up.
#include <vector> | ||
|
||
using namespace boost::container; |
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.
❤️ (change not related to this PR's topic, but like the change)
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.
IWYU was confusing slist from boost with the one from gcc, obviously couldn't include that one, so that just triggered getting rid of the boost container namespace and using it more directly with the full name of the types
Co-authored-by: Henry Schreiner <[email protected]>
This has been bounced around for a couple years now
#474 and a few others have expressed desire to work with non-standard option names. We have been somewhat resistant to that but I think it can be done now. This PR adds a modifier
allow_non_standard_option_names()
It is purposely long, it is purposely off by default. But what it does is allow option names with a single-
to act like a short option name. With this modifier enabled no single letter short option names are allowed to start with the same letter as a non-standard names. For example-s
and-single
would not be allowed.