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

Added bash and zsh autocompletion #252

Merged
merged 9 commits into from
Nov 28, 2018
Merged

Added bash and zsh autocompletion #252

merged 9 commits into from
Nov 28, 2018

Conversation

rsteube
Copy link
Collaborator

@rsteube rsteube commented Nov 27, 2018

Added bash and zsh autocompletion generation using cobra. This is based on the currently ongoing PR by babysnakes which i forked to support zsh custom completion for positional arguments.
When babysnakes PR finally lands in cobra, the changes shouldn't differ too much.

The bash version simply completes the commands while the zsh one has some additional argument completion (like menu completion of issue numbers with their title).

  • added Gopkg files (dep)
  • fixated 2 dependencies to an older commit in lock file (build problem)
  • changed cobra source to my personal fork
  • added lab completion {bash,zsh} command
  • added some initial positional argument completions using lab and git invocations

The remote argument of some commands is currently skipped. I started working on that, but this might be a good first iteration since most of it seems to work so far.

see #40
changes made in my cobra fork can be seen here: babysnakes/cobra@zsh-completion...rsteube:zsh-completion-custom

@rsteube
Copy link
Collaborator Author

rsteube commented Nov 27, 2018

Seems the build fails because it doesn't use dep: https://travis-ci.org/zaquestion/lab/builds/460512521#L498

@zaquestion
Copy link
Owner

Yeah we switch over to go modules recently. Likely you just need to upgrade to go1.11 and do something like GO111MODULE=on go build . and the go.mod file should get updated. Thanks for putting this together, I'll try to pick it up this weekend if we're still facing issues.

@codecov
Copy link

codecov bot commented Nov 28, 2018

Codecov Report

Merging #252 into master will increase coverage by 0.02%.
The diff coverage is 70.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #252      +/-   ##
==========================================
+ Coverage   68.32%   68.34%   +0.02%     
==========================================
  Files          42       43       +1     
  Lines        2251     2278      +27     
==========================================
+ Hits         1538     1557      +19     
- Misses        554      562       +8     
  Partials      159      159
Impacted Files Coverage Δ
cmd/root.go 72.93% <ø> (ø) ⬆️
cmd/mr_approve.go 27.27% <100%> (+7.27%) ⬆️
cmd/project_list.go 93.1% <100%> (+0.24%) ⬆️
cmd/issue_close.go 100% <100%> (ø) ⬆️
cmd/mr_close.go 100% <100%> (ø) ⬆️
cmd/mr_browse.go 100% <100%> (ø) ⬆️
cmd/mr_show.go 100% <100%> (ø) ⬆️
cmd/mr_merge.go 30% <100%> (+7.77%) ⬆️
cmd/mr_thumb.go 27.27% <100%> (+7.27%) ⬆️
cmd/snippet_delete.go 73.33% <100%> (+1.9%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e7613a...6b308c1. Read the comment docs.

@rsteube
Copy link
Collaborator Author

rsteube commented Nov 28, 2018

Ah, didn't know about modules yet. I was looking for something like that but it seems i was blind and didn't expect the files to be called *.mod and *.sum. Added a replace instruction to the go.mod.

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

2 participants