vladimir-kotikov / clink-completions

Completion files to clink util
MIT License
376 stars 81 forks source link

Integration with pythons argument parser #146

Open binyaminyblatt opened 2 years ago

binyaminyblatt commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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.

binyaminyblatt commented 2 years ago

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 commented 2 years ago

@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 commented 1 year ago

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

chrisant996 commented 1 year ago

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.