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

Add bash/zsh auto completion generation #1

Open
integrii opened this issue Mar 23, 2018 · 3 comments
Open

Add bash/zsh auto completion generation #1

integrii opened this issue Mar 23, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@integrii
Copy link
Owner

We should generate bash auto complete code when some pre-defined flag is specified. The flag should be able to be turned off if the user prefers that flag not be used by the system.

@integrii integrii added the enhancement New feature or request label Mar 23, 2018
@integrii integrii changed the title Add bash auto completion generation Add bash/zsh auto completion generation Apr 29, 2018
@philippgille
Copy link

Maybe rather a subcommand? Like './myApp installAutoCompletion'. Or make it configurable (app developer can choose between flag and subcommand, as well as change the flag and subcommand).

@integrii
Copy link
Owner Author

I think a subcommand makes more sense for sure.

The main challenge I see here is not using a 3rd party package. I want to keep flaggy a zero dependency package.

@WhyNotHugo
Copy link

A possible approach to avoiding third party dependencies is implementing this feature in a separate package. I'm thinking of something like this:

  • All the command definitions (e.g.: in application code, not here) need to be moved out of the main package.
  • The third-party lib can read all of flaggy's commands and settings.
  • The third party lib generates the completions.

Note that the approach also allows having a separate binary that generates the completions, so the new library doesn't even need to be build into the application binary itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants