Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with pythons argument parser #146

Open
binyaminyblatt opened this issue May 25, 2022 · 6 comments
Open

Integration with pythons argument parser #146

binyaminyblatt opened this issue May 25, 2022 · 6 comments

Comments

@binyaminyblatt
Copy link

I don't know if it's possible or if this even is the right place to be requesting it but there are a lot of autocomplete integrations for pythons argument parser or bash and zsh I was wondering if it was possible to either hook into one of those or have a similar one for clink
https://github.com/kislyuk/argcomplete

@chrisant996
Copy link
Collaborator

Is the question about how to automatically make completion scripts from bash/zsh/fish/etc work in Clink? That isn't feasible without embedding those entire shells and scripting languages into Clink, which would be going a bit overboard, and would never be able to be fully functional.

However, there is a fishcomplete.lua script in clink-gizmos that is able to make some simple fish completion scripts work in Clink.

Or, is the question about porting one or two specific completion scripts to Clink?

@chrisant996
Copy link
Collaborator

@binyaminyblatt I'm the new maintainer for this repo, and I'm also the maintainer for Clink.

I think you are asking for python-specific completions while typing a python command line. Is that an accurate understanding of what argcomplete (etc) do?

It would certainly be possible to write one for Clink. I don't use python, myself, so it's not something I'm likely to create in the near future. Someone else is welcome to do so and submit a pull request.

@chrisant996 chrisant996 added enhancement Planned enhancement feature-request A requested enhancement needs investigation and removed enhancement Planned enhancement labels Aug 15, 2022
@binyaminyblatt
Copy link
Author

binyaminyblatt commented Aug 18, 2022

Python has packages which can interact with the shell to make the arguments accessible so it would probably need to be both a script and a package for python so it would be accessible from both sides the package would pass the information to the script

This by the way is the way the argument parser for bash works

@chrisant996
Copy link
Collaborator

@binyaminyblatt can you show 2 or 3 specific examples of completions that you would like?

What do I need to install to use the python commands?
What is the command line to type before invoking completion?
What is the completion that should happen?

@binyaminyblatt
Copy link
Author

argcomplete is the package that works on Linux it doesn't work on Windows but it would need to do something similar

@chrisant996
Copy link
Collaborator

I don't have the interest or time to go learn everything for how to install python, configure it to support argcomplete, and figure out example completions to test. If someone can explain those parts, then I might be willing to work on this. Otherwise, someone else is welcome to work on this. I'm willing to do the work of actually hooking it up -- but I'm not willing to go research and learn everything starting from zero knowledge; that's too expensive for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants