Coder Social home page Coder Social logo

Comments (2)

bzdzb avatar bzdzb commented on May 24, 2024 1

I started to fix this bug, but after looking at the tests realized that this was intentional behavior. I encountered this issue when trying to implement a parser.stored() call with the arg --s3-bucket. Since this is a perfectly reasonable arg name, I think this design decision might warrant reconsideration. I'd be happy to submit a pull request if you agree that it makes sense. Thanks.

from kotlin-argparser.

xenomachina avatar xenomachina commented on May 24, 2024

@bzdzb from looking at where ARG_NAME_RE is defined, I suspect that this was not actually intentional. Instead of $ARG_INITIAL_CHAR_CLASS+, $ARG_INITIAL_CHAR_CLASS$ARG_CHAR_CLASS* would probably make more sense.

I'm also thinking that it may make sense to require $ARG_INITIAL_CHAR_CLASS after a ..

So these should be valid:

url1
url_1
url-1
http_url1
http_url_1
http_url-1
http-url1
http-url_1
http-url-1
http.url1
http.url_1
http.url-1
http_url_1_host
http_url_1-host
http_url-1_host
http_url-1-host
http_url1_host
http_url1-host
http-url_1_host
http-url_1-host
http-url-1_host
http-url-1-host
http-url1_host
http-url1-host
http.url_1_host
http.url_1-host
http.url-1_host
http.url-1-host
http.url1_host
http.url1-host

but these should be invalid:

3com
3_com
3-com
3.com
http_url.1
http-url.1
http.url.1
http_url.1_host
http_url.1-host
http-url.1_host
http-url.1-host
http.url.1_host
http.url.1-host
-url
_url
url_
url-
.url
url.

If you'd be willing to make a PR, I'd really appreciate it.

from kotlin-argparser.

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.