elves / elvish

Powerful scripting language & versatile interactive shell

Home Page:https://elv.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are there any good examples for custom completion script?

shannmu opened this issue · comments

I am working on a project about Command Line Argument Parser, specifically the part about supporting dynamic completion. I saw in the elvish manual (https://elv.sh/ref/edit.html#edit:completion:start) that there are some APIs that might be used for completion, such as $edit:-dot, $edit:completion:arg-completer, $edit:completion:binding, $edit:completion:matcher, and $edit:current-command.
However, I am not an elvish user, so I am not quite sure how to implement the completion feature for a command using elvish script. Are there any good examples available?

@shannmu -- you may also be interested in carapace: https://carapace.sh and you can see how it generates elvish completions