Comments (4)
Yeh, I would post it to the original repo first; I like to try to keep feature parity. But what you suggest could be tricky to do, because I'm not sure how to tell the difference.
from docopt.cpp.
Hi @jaredgrubb, Thanks for you reply.
I will post the issue in the original Python repo, but it seems that the maintainer is not very active these days. I understand that you want to keep feature parity.
Regarding negative values, I think it is pretty safe to assume that if you have number after the "-", then it is a negative value and not an option. I have been playing in a fork and made some modification and seems to be working for me. I will not create a PR since I think you will like this to be address first in the Python docopt.
from docopt.cpp.
I'm not sure about this because the first thing that comes to mind for me are things like xargs which has an option -0
. Needless to say, negative values aren't applicable in this case, it represents null terminated arg handling. Maybe the negative value stuff should be behind an option in docopt? I don't think parsing dashes with digits should necessarily be negative by default.
from docopt.cpp.
I'm thinking of fixing this issue in my Unreal Engine port. The way I'd do it is, if I see a -
character in a token then I'll check to see if the token starts with a -
and not a --
, a.k.a it's a short option. Then I'll check the next character after the -
and if it's numeric then I'll parse it as a negative integer instead of a short option.
Wouldn't know how to do this outside of UE4 though, I'm not great with string manipulation in standard C++. So I may not be able to contribute the fix to this repo.
from docopt.cpp.
Related Issues (20)
- CMake Windows: install *.dll in the correct location HOT 1
- Feature Request: Please support default that picks up value from environment variable HOT 3
- Better CMake
- New release proposal HOT 5
- Unable to add short version of option HOT 10
- Suggestion: docopt::value to provide a `represent` method rather than overloading operator<< for std::ostream HOT 1
- Crash in 0.6.3 HOT 3
- Visual Studio 2015 link error in example for ostream output operator of value HOT 2
- replacing std::regex with ctre HOT 3
- Packaging for Debian is incorrect. Should be splitted into multiple packages using CPackComponent and renamed for debian into libdocopt-dev and libdocopt HOT 2
- Compile time parse usage
- Argument names with characters other than letters (like underscores or numbers) don't work HOT 1
- Using optional args out of order leads to wrong values all around HOT 2
- MSAN Warning on use-of-initialized-value in docopt::docopt_parse HOT 2
- Update vcpkg port
- Should docopt::Options be an std::unordered_map? HOT 2
- Missing support for comments HOT 2
- Unclear/undocumented value interface. HOT 4
- Unused variable in `Option::parse`
- Version 0.6.3 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 docopt.cpp.