Comments (3)
What sort of filtering do you want? Do you mean something like stopping at --
?
from cxxopts.
Stopping at --
seems like a reasonable solution.
from cxxopts.
Currently it does already stop at --
, but then it treats everything else as a positional argument. So you can almost get what you want by having no positional arguments and then fetching the unmatched arguments, which returns a vector of the remaining arguments.
I have previously changed this code to specifically not modify argv at all, because it was causing a lot of people problems to have argv as non const, and they weren't expecting argv to change.
Maybe one small change that would suit your use case is to make the last matched argc accessible. Then you can just pass &argv[new_argc]
to your second piece of code.
from cxxopts.
Related Issues (20)
- Branch Name: main HOT 1
- About a new tag-release HOT 1
- feature request/question: support the one dash as argument HOT 2
- Feature request: value pairs or tuples HOT 1
- Renaming of OptionException should be mentioned in changelog HOT 1
- Allow "G", "M" and 'k' when parsing arguments HOT 2
- Getting a sign-conversion warning/error with clang 14 and CXXOPTS_USE_UNICODE_HELP ON HOT 2
- A proposition to implement any complex rule on the arguments
- unannotated fall-through between switch labels HOT 3
- Are unrecognized options supported? HOT 1
- std::bad_alloc during dlopen on integer_pattern initialization HOT 4
- In Linux systems, the tilde symbol (~) cannot be automatically expanded to "/home/user1," HOT 4
- -option Error message. I think we should not just report command āpā error. HOT 5
- Report a typo in README.md doc(in master branch) HOT 1
- What is the use of constructor parameters in options("MyProgram", "One line description of MyProgram")? HOT 3
- cxxopts-3.2.0 breaks in c++20 mode: invalid operands to binary expression ('std::stringstream' (aka 'basic_stringstream<char>') and 'std::optional<bool>' HOT 8
- Add + as an argument indicator
- short arg unable to accept argument. HOT 2
- Sub-options support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cxxopts.