Code Monkey home page Code Monkey logo

Comments (4)

jaredgrubb avatar jaredgrubb commented on August 16, 2024

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.

delarosatrevin avatar delarosatrevin commented on August 16, 2024

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.

andrew-kennedy avatar andrew-kennedy commented on August 16, 2024

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.

 avatar commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.