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

Adding tab completion functionality for Bash and Zsh #56

Merged
merged 3 commits into from
Jun 19, 2020

Conversation

IdlePhysicist
Copy link
Contributor

Pretty small addition to the code base but I felt it was a worthy one since cobra has completion generation built in.

Comments welcome, and rejection too.

@lwahlmeier
Copy link
Member

@IdlePhysicist dont worry about the build, we apparently where using alpine:latest for the stim image base and alpine:3.12 does not have python2. I will push up a change to master to move it to alpine:3.11 once thats merged into your branch it should fix the build issue.

`,
ValidArgs: []string{"bash", "zsh"},
Run: func(cmd *cobra.Command, args []string) {
if err := c.stim.GetCompletion(args[0]); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

need to check that len(args) > 0 before hitting this line. stim completion causes a stack trace w/o useful messages. There might be a way to have cobra/viper do that for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did try to do the arg validation a more extravagant way, but I think this will suffice. It will fail gracefully & exit for len(args) != 1 and in the switch statement in stim/completion.go I am logging out "unknown shells".

@lwahlmeier
Copy link
Member

Fixed master build, get that merged in so we can get the build to pass, also left one comment we should probably take care of, but then I think it looks good to merge.

@bartlettc22 bartlettc22 self-requested a review June 19, 2020 16:43
@lwahlmeier lwahlmeier merged commit 5dedfad into PremiereGlobal:master Jun 19, 2020
@IdlePhysicist IdlePhysicist deleted the completion branch September 20, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants