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 support for Zsh completion to beats subcommand #5761

Merged
merged 6 commits into from
Nov 30, 2017

Conversation

ph
Copy link
Contributor

@ph ph commented Nov 29, 2017

Update the cobra library and enable zsh support for completion, you can generate the completion using the following command:

./filebeat completion zsh > _filebeat

Make sure the file is in your $fpath, you can find your currently configured path with echo $fpath and add another one with fpath = ($fpath /my/newpath) in your .zshrc

Note to reviewer I can split the update of the library with the Zsh if preferred.

@ph ph force-pushed the feature/support-zsh-completions branch from 54ae988 to 536f809 Compare November 29, 2017 19:08
@ph ph added the review label Nov 29, 2017
@ph ph force-pushed the feature/support-zsh-completions branch from 536f809 to 8b90007 Compare November 29, 2017 19:20
@kvch
Copy link
Contributor

kvch commented Nov 29, 2017

Just curious: is the command has to be run by the user even if the Beat is installed from a package?

@ph
Copy link
Contributor Author

ph commented Nov 29, 2017 via email

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great! 🎉 related to #5617

@@ -16,6 +16,9 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di

- Support dashboard loading without Elasticseach {pull}5653[5653]
- Addition and update of the following libraries: pbkdf2, terminal, windows, unix {pull}5735[5735]
- Update the command line library cobra {pull}X[X]
- Add support for Zsh for the completion subcommand {pull}X[x]
- Update the command line library cobra and add support for zsh completion {pull}5761[5761]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something went wrong here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh bad rebase on multiples commits.

@ph ph force-pushed the feature/support-zsh-completions branch from 8b90007 to d282bb5 Compare November 29, 2017 20:10
@ph
Copy link
Contributor Author

ph commented Nov 29, 2017

Just to keep it in mind, the cobra generator for zsh is minimal and wont handle flags for now.
see spf13/cobra#497

@ruflin ruflin merged commit 94aaed2 into elastic:master Nov 30, 2017
@ruflin
Copy link
Contributor

ruflin commented Nov 30, 2017

@ph @exekias We should also have that in our docs somewhere I think?

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

Successfully merging this pull request may close these issues.

4 participants