GithubHelp home page GithubHelp logo

Comments (8)

brettcannon avatar brettcannon commented on June 17, 2024 1

Yep, hence this project exists and functions at all. 😉

My point is it will take more time and effort to support what you're asking for and I don't think it's worth it. Doing --list --help once and reading the error message that says to run --help on its own is a one-time thing if you even happen to even run into it. I don't think increasing the code complexity to let you specify --help in multiple positions when it doesn't make sense to me as to what --list --help would even produce for output is worth the effort in supporting. I would much rather just tell the user "you're not using the flags the way the tool was designed; see py --help for details" then try to support this.

As such, I'm not planning to make any more changes around this beyond what I have already done. I understand your suggestion and I appreciate the input, but it isn't worth it to me to implement this idea and/or the support cost of the resulting code.

from python-launcher.

gaborbernat avatar gaborbernat commented on June 17, 2024

Sorry to comment here but #77 is locked, so can't do it there,

the current design only checks the first argument and ignores the rest to pass on to Python

I understand, this is highly unexpected for me at least. No other tool I know does this, so I wasn't aware.

Doesn't rust has some form of parse_known_args? :-) Rather than just the first argument?

from python-launcher.

brettcannon avatar brettcannon commented on June 17, 2024

Unfortunately the flag for the Launcher is dynamic since you could literally say any Python version (else I would have used an argument parsing library and simplified my life 😉). Unless I do a complete version search upfront and then construct the possible completions I can't know ahead of time what the possible flags are. And doing that seems unnecessarily costly just for this use-case.

from python-launcher.

gaborbernat avatar gaborbernat commented on June 17, 2024

I meant parse known args from the python-launcher POV 👍🏻 We can forward everything else to the resolved interpreter.

from python-launcher.

brettcannon avatar brettcannon commented on June 17, 2024

Right, but there is no "known args from the Python Launcher POV" without knowing what all potential Python versions are. E.g. the Launcher doesn't know if -3.6 is a valid flag to specify when you want Python 3.6. Same goes for 0.9, 42.1, etc. The only way to know that list of flags would be is to do a complete version search like --list does to calculate all valid version flags. This is why I had to hand-roll CLI flag parsing myself since I can't statically specify it otherwise.

from python-launcher.

gaborbernat avatar gaborbernat commented on June 17, 2024

As far as I understand currently known args are --help, --list and any -x.y where x and y are 1+ digit. That's seems fairly simple to parse and handle, no?

from python-launcher.

gaborbernat avatar gaborbernat commented on June 17, 2024

I mean I understand your point, but if just 1000 users run into this and 1000 times you have to tell them to not do it, it will be cheaper to just support it IMHO.

from python-launcher.

brettcannon avatar brettcannon commented on June 17, 2024

I've locked the conversation as I consider this topic resolved.

from python-launcher.

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.