Giter Club home page Giter Club logo

Comments (5)

lcannon avatar lcannon commented on July 18, 2024

Forgot to say, I just upgraded to the latest and greatest from pip, 0.6.7,

from argcomplete.

kislyuk avatar kislyuk commented on July 18, 2024

Yeah, nested subparsers behave weirdly. When I looked into it, I found that figuring out which subparsers are eligible to receive the next word is really hard, so for now I just throw all subparsers that I can find into the mix of active parsers. If you have a better way to determine active subparsers, by all means please submit a patch. The relevant code is in https://github.com/kislyuk/argcomplete/blob/master/argcomplete/__init__.py#L189.

from argcomplete.

bbejot avatar bbejot commented on July 18, 2024

I tried this out and it seems to be fixed. I used version 1.6.0

$ ./testcase.py lookup [tab][tab]
a b c -h --help
$ ./testcase.py lookup a [tab][tab]
env etc -h --help
$ ./testcase.py lookup a env [tab][tab]
aaa -h --help zzz
$ ./testcase.py lookup a env aaa [tab][tab]
-h --help

This looks like correct behavior to me and seems to be inline with what argparse is expecting.

from argcomplete.

kislyuk avatar kislyuk commented on July 18, 2024

Thanks for verifying, @bbejot.

from argcomplete.

evanunderscore avatar evanunderscore commented on July 18, 2024

@bbejot Would you like to submit a PR for a test case that verifies this? If not I'll add one when I get around to it.

from argcomplete.

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.