My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

bash / zsh completion function in python / golang

Ahmad Ismail's photo
Ahmad Ismail
·Sep 9, 2020·

1 min read

For example the following is a zsh completion function for command foo:

#compdef _foo foo
compadd first second third fourth

So, if we type foo <tab> in the zsh terminal, it suggests first second third fourth.

I think I found few projects which help us write shell completion functions in python.

click.palletsprojects.com/en/7.x/bashcomplete

github.com/dan1994/pyzshcomplete

github.com/kislyuk/argcomplete

github.com/CarvellScott/completion_utils

I could find one project which help us write shell completion functions in golang.

github.com/posener/complete

What do you suggest I use?