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 zsh completion for log options #17334

Merged
merged 1 commit into from
Nov 17, 2015

Conversation

sdurrheimer
Copy link
Contributor

Add completion for log options.

But I have a question, are env, labels and tag available for all log drivers or only for a few ? It's a little bit hard to understand in log driver docs.

@vincentbernat

Signed-off-by: Steve Durrheimer s.durrheimer@gmail.com

@vdemeester
Copy link
Member

@sdurrheimer env and labels are for json-file, journald, gelf and fluentd. For tags, I'm not sure 😅.

@thaJeztah
Copy link
Member

Hm, I'll have to check as well. I wonder if we should just "assume" a driver supports all non-namespaced options (I.e. the options that are not prefixed with the driver-name), and make it a responsibility of the user to read the docs to check if the driver supports the flag (if a driver doesn't support it, will it silently be ignored). I can imagine all these options are a nightmare to maintain in the completions

@sdurrheimer sdurrheimer force-pushed the zsh-completion-log-options branch 2 times, most recently from 427cb2e to 4f0f5e8 Compare October 25, 2015 13:33
@calavera
Copy link
Contributor

I wonder if we should just "assume" a driver supports all non-namespaced options

let's assume that in the completion, it will make our lives much easier.

@sdurrheimer
Copy link
Contributor Author

Do we agree on making env labels and tag global log options in zsh completion even if those options are not necessarily used by all log drivers ?

@thaJeztah
Copy link
Member

@sdurrheimer sgtm, I think that'd make it a lot easier to maintain

@vdemeester
Copy link
Member

@sdurrheimer @thaJeztah It really depends if those flags are ignored or if they make the command fail 😅 .

@albers
Copy link
Member

albers commented Oct 27, 2015

In bash completion, these options are not global: https://github.com/docker/docker/blob/master/contrib/completion/bash/docker#L331-L337.
(I'm not sure if this matrix is really correct, though.)

This makes me wonder whether both completions have to behave identically here. IMHO, not necessarily. For bash, I think we should keep the working solution. For zsh, a pragmatic approach with global options might be good enough.

@thaJeztah
Copy link
Member

Thanks for your input @albers, yes ideally, the options should match the actual situation, but I can live with doing it on a "best effort" base, and defining them globally

@sdurrheimer
Copy link
Contributor Author

@thaJeztah The current version is without global_options, similar to what @albers has done with bash.
But I can modify it to make env labels and tag global if you want me to.

(I need to rebase before merge)

@thaJeztah
Copy link
Member

@sdurrheimer I'm good with the current approach (it's the "better" solution, albeit more demanding on maintenance), we can move to global options if it becomes to hard to maintain (just my 0.02c)

@sdurrheimer sdurrheimer force-pushed the zsh-completion-log-options branch from 4f0f5e8 to dff6d63 Compare October 27, 2015 13:58
@sdurrheimer
Copy link
Contributor Author

Ok rebased.

@vincentbernat for review.

@vincentbernat
Copy link
Contributor

Wouldn't it be easy to move the whole log-options state handling into the __docker_log_options function? $opt_args should be accessible directly from the function.

@sdurrheimer sdurrheimer force-pushed the zsh-completion-log-options branch from dff6d63 to 6618710 Compare October 30, 2015 08:59
@sdurrheimer
Copy link
Contributor Author

I've done a little refactoring.

@calavera
Copy link
Contributor

calavera commented Nov 2, 2015

LGTM

@sdurrheimer sdurrheimer force-pushed the zsh-completion-log-options branch 3 times, most recently from c346f1f to 4862fa8 Compare November 12, 2015 07:29
@sdurrheimer
Copy link
Contributor Author

tag, env and labels added for splunk driver as requested in #17891

@thaJeztah

@vdemeester
Copy link
Member

LGTM 🐮
We probably should wait for #17891 to be merged though, right ? 😝

@sdurrheimer
Copy link
Contributor Author

Good to me

@sdurrheimer sdurrheimer force-pushed the zsh-completion-log-options branch from 4862fa8 to 75470b3 Compare November 12, 2015 08:11
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
@sdurrheimer sdurrheimer force-pushed the zsh-completion-log-options branch from 75470b3 to 76fe00c Compare November 12, 2015 08:53
@LK4D4
Copy link
Contributor

LK4D4 commented Nov 17, 2015

LGTM

LK4D4 added a commit that referenced this pull request Nov 17, 2015
@LK4D4 LK4D4 merged commit 346d195 into moby:master Nov 17, 2015
vincentbernat added a commit to vincentbernat/docker that referenced this pull request Nov 18, 2015
LXC support has been deprecated and the related completion has been
removed in moby#17700 but was added back in moby#17334.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
@sdurrheimer sdurrheimer deleted the zsh-completion-log-options branch November 18, 2015 07:31
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.

8 participants