-
Notifications
You must be signed in to change notification settings - Fork 163
Add shell completion files #30
Comments
Hey sorry to bother @p-e-w but could you explain what we are trying to achieve here? |
@sanketplus: Here is the basic problem (bash):
bash supports programmable completion. A completion script needs to be added so bash knows that Other shells handle completion differently. Notably, fish appears to draw from |
are you working on it already? |
No, and in fact I have no clue how to achieve it yet 😉 I'd be very happy to accept a pull request for this issue. Looking at Or we can just wait for everyone to migrate to fish instead... 🐟 😄 |
can this help? |
argcomplete looks fantastic – I had no idea something like this existed! From the documentation, it seems that it will take care of option completion automatically, which leaves only completion of the command to be implemented. I'm still unsure how to best approach this, as argcomplete's In any case, argcomplete definitely looks like the way to go. 👍 |
While digging more on the same I discovered the following! A similar but more simpler CLICK which can replace both argparser and argcomplete And for completion which BASH uses, it happens that BASH is using readline library. The file you were searching for is maybe /usr/share/bash-completion/bash_completion. I got it's path from file /etc/bash_completion (Ubuntu) What we can do is for command line args we can use either Click or Argparse and for rest of the completion we can use BASH Completion ( |
WHOA!! 😲 and after that |
I found
similar to what you discovered. I have searched the web in vain for more details on parameters like There is just one problem: It does not seem to be possible to specify the simple command Had a look at Click too (which was also new to me). It has some nice ideas, but also a big red flag:
No offense to the author, but I strongly disagree. optparse has been deprecated since Python 2.7. It might very well be removed in a future Python version. If that happens, and Click does not get fixed, |
It sounds an interesting problem. I will check it tomorrow. |
Instead of using argparse + argcomplete and inbuilt BASH completion ( How about that? 😃 |
Two potential issues:
|
Alternatively:
how about this approach @p-e-w ? |
I use the /etc/bash_completion.d/ in my fork. |
No description provided.
The text was updated successfully, but these errors were encountered: