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

Completion support #186

Open
3noch opened this issue Jul 2, 2022 · 4 comments
Open

Completion support #186

3noch opened this issue Jul 2, 2022 · 4 comments
Labels
v2-planned Planned for v2

Comments

@3noch
Copy link

3noch commented Jul 2, 2022

I love the design of this library. However I could not find any information about generating completion scripts from the reflected CLI. This would be a fantastic addition!

@alexflint
Copy link
Owner

Oh this would be great! I will likely look into this in the near future.

@alexflint
Copy link
Owner

alexflint commented Jul 3, 2022

Here is a library that sets up a separate binary that provides completion support for the primary binary: https://github.com/posener/complete/tree/master

Ultimately, completions are installed into bash by appending a complete -C command to .bashrc: https://github.com/posener/complete/blob/master/install/bash.go#L36

Here is how it looks for the go build system: https://github.com/posener/complete/blob/05b68ffc813dd10c420993cb1cf927b346c057b8/gocomplete/complete.go

@3noch
Copy link
Author

3noch commented Jul 4, 2022

I've seen tools add an optional subcommand like app generate-completions that is automatically derived by the CLI library, similar to how --help is derived automatically.

@alexflint
Copy link
Owner

Tagging as planned for v2

@alexflint alexflint added the v2-planned Planned for v2 label Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2-planned Planned for v2
Projects
None yet
Development

No branches or pull requests

2 participants