Skip to content

man page menu completion on another command #287

Answered by akinomyoga
mozirilla213 asked this question in Q&A
Discussion options

You must be logged in to vote

In commit 54ace59, I have extracted the related code as an independent function ble/complete/source:option/generate-for-command.

With this new interface, you can essentially do something like the following:

complete -F _comp_runme runme
_comp_runme() { ble/complete/source:option/generate-for-command myscript.sh "${comp_words[@]:1:comp_cword-1}"; }

More careful implementation of _comp_runme can be found here.

The usage of ble/complete/source:option/generate-for-command is briefly explained in the code comment.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@mozirilla213
Comment options

@akinomyoga
Comment options

@akinomyoga
Comment options

@mozirilla213
Comment options

@akinomyoga
Comment options

Comment options

You must be logged in to vote
3 replies
@akinomyoga
Comment options

@mozirilla213
Comment options

@akinomyoga
Comment options

Answer selected by mozirilla213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
NYI/NewFeat Not yet implemented or New Feature
2 participants