Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot have completion for multiple functions #874

Closed
fearphage opened this issue May 4, 2017 · 2 comments · Fixed by #1903
Closed

Cannot have completion for multiple functions #874

fearphage opened this issue May 4, 2017 · 2 comments · Fixed by #1903

Comments

@fearphage
Copy link

If you have two tools built on yargs, they will clobber each other. Based on the current implmenetation, they will both define a function (_yargs_completions()) and one will overwrite the other. The last one will win. I'm addressing this now in related issue (#831). I just wanted to log it so it is known.

@bcoe
Copy link
Member

bcoe commented Apr 3, 2021

@jacobator @gardenappl as folks using yargs' completion functionality, any thoughts on this long standing bug? I wonder what a good approach would be

@jacobator
Copy link
Contributor

@bcoe https://github.com/yargs/yargs/blob/master/lib/completion-templates.ts. It looks like for zsh there's an app-specific function defined _{{app_name}}_yargs_completions() while it's generic _yargs_completions() for bash. Should be an easy fix. I can test and create a PR this evening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants