38f276a732238008a8d0e4a028a4f112bca56221

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

docker: document option-stacking setting

Fixes #9266

Diff

 1diff --git a/plugins/docker/README.md b/plugins/docker/README.md
 2index 241a6a448444a5784a8d15b5326e7f9f928df2bf..fab7aa8f15317ff02e9a1076c2300f3a20299ab3 100644
 3--- a/plugins/docker/README.md
 4+++ b/plugins/docker/README.md
 5@@ -10,3 +10,25 @@ plugins=(... docker)
 6 
 7 A copy of the completion script from the docker/cli git repo:
 8 https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker
 9+
10+## Settings
11+
12+By default, the completion doesn't allow option-stacking, meaning if you try to
13+complete `docker run -it <TAB>` it won't work, because you're _stacking_ the
14+`-i` and `-t` options.
15+
16+[You can enable it](https://github.com/docker/cli/commit/b10fb43048) by **adding
17+the lines below to your zshrc file**, but be aware of the side effects:
18+
19+> This enables Zsh to understand commands like `docker run -it
20+> ubuntu`. However, by enabling this, this also makes Zsh complete
21+> `docker run -u<tab>` with `docker run -uapprox` which is not valid. The
22+> users have to put the space or the equal sign themselves before trying
23+> to complete.
24+>
25+> Therefore, this behavior is disabled by default. To enable it:
26+>
27+> ```
28+> zstyle ':completion:*:*:docker:*' option-stacking yes
29+> zstyle ':completion:*:*:docker-*:*' option-stacking yes
30+> ```