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 rudimentary fish completions for docker network #2066

Merged
merged 1 commit into from Aug 30, 2019

Conversation

sanga
Copy link
Contributor

@sanga sanga commented Aug 25, 2019

Signed-off-by: Tim Sampson tim@sampson.fi

- What I did
The fish completions are rather out of date. This ever so slightly improves the situation by including some basically completions for docker network (which I happen to use frequently).
- How I did it
- How to verify it
Open up a fish shell and try to tab-complete various docker network commands
- Description for the changelog
improved fish shell completions for docker network.

- A picture of a cute animal (not mandatory but encouraged)

This is my first contribution to docker, I believe I have followed the appropriate guidelines but if I've misread or -understood something apologies beforehand,

Signed-off-by: Tim Sampson <tim@sampson.fi>
@codecov-io
Copy link

Codecov Report

Merging #2066 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2066   +/-   ##
=======================================
  Coverage   56.78%   56.78%           
=======================================
  Files         311      311           
  Lines       21836    21836           
=======================================
  Hits        12400    12400           
  Misses       8520     8520           
  Partials      916      916

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #2066 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2066   +/-   ##
=======================================
  Coverage   56.78%   56.78%           
=======================================
  Files         311      311           
  Lines       21836    21836           
=======================================
  Hits        12400    12400           
  Misses       8520     8520           
  Partials      916      916

@thaJeztah
Copy link
Member

Thanks! I recall that the completion used to be generated by a script (see a comment in that file); https://github.com/barnybug-archive/docker-fish-completion. That script has been archived though; if updating that script would make it easier to maintain (and update these), we could consider including it in the contrib directory.

One problem is that that repository doesn't have a license, so we probably can't just take it, unless @barnybug makes that contribution 🤔 (alternatively, look into contributing a Fish variant to spf13/cobra, and use that for generating; similar to https://github.com/spf13/cobra/blob/master/bash_completions.go)

@sanga
Copy link
Contributor Author

sanga commented Aug 30, 2019

Scripting the generation of completions sounds like a much better idea than doing stuff manually. Adding fish completion generation to cobra is outside of my skillset and available freetime. However if @barnybug 's python script needs some nursing I'm happy to help there. Obviously it would need a compatible license to be committed here but as it stands I could update this commit with completions generated from it (assuming getting it working again isn't too much hassle) if that's agreeable for you @thaJeztah ? As a temp workaround, as the fish completions are currently very much out of date.

@thaJeztah
Copy link
Member

Let's get this one merged and work from there, because this changes looks good to me (and at least brings it in a slightly better state).

Fish is (unfortunately) less popular than Bash, and gets less care w.r.t. the completions scripts; and without a dedicated person helping with maintaining those scripts, I think generating them would be a good way forward (leaning towards having it integrated into Cobra here, but if we have the python script as intermediate solution works).

Our Bash completion scripts have been fully hand-written, which takes a lot of effort but definitely gives a higher quality than generated ones (and we're lucky to have people passionate about maintaining them).

With Apple's decision to switch to zsh as default shell in the next macOS (Catalina) release, I expect more people using that shell (we may want to consider generating those)

Let me take a few minutes to write up a tracking issue / epic for things we can work on w.r.t. improving the completion scripts; I'll post a link here once I did so.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!!

@thaJeztah thaJeztah merged commit 2edafa1 into docker:master Aug 30, 2019
@GordonTheTurtle GordonTheTurtle added this to the 19.09.0 milestone Aug 30, 2019
@sanga
Copy link
Contributor Author

sanga commented Sep 1, 2019

Btw, I had a little look at cobra and it seems like generated fish completions is almost over the line spf13/cobra#754

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

Successfully merging this pull request may close these issues.

None yet

4 participants