Skip to content

Conversation

@albers
Copy link
Collaborator

@albers albers commented Nov 10, 2017

service create and service update both used to have --env, --label and --mount options.
These options now are only valid for service create.
service update got corresponding --xxx-add|rm options instead.

Also removes some duplication between the completions for --xxx and the corresponding
-xxx-add and -xxx-rm options.

@codecov-io
Copy link

codecov-io commented Nov 10, 2017

Codecov Report

Merging #682 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #682      +/-   ##
==========================================
+ Coverage   53.44%   53.45%   +<.01%     
==========================================
  Files         218      218              
  Lines       14613    14613              
==========================================
+ Hits         7810     7811       +1     
+ Misses       6322     6321       -1     
  Partials      481      481

`service create` and `service update` both used to have `--env`, `--label`
and `--mount` options.
These options now are only valid for `service create`.
`service update` got corresponding `--xxx-add|rm` options instead.

Signed-off-by: Harald Albers <github@albersweb.de>
Previously, the completions for `--xxx` and the corresponding
`-xxx-add` and `-xxx-rm` options were defined in separate blocks.
This caused a lot of duplicated code.

This PR removes duplication for xxx=config|group|host|placement-pref|secret.

Now the blocks for `create` and `update` only contain completions for
options that either only exist for the particular command or are specific
to it (completions for `--env-rm` and `--env|env-add` differ).

Signed-off-by: Harald Albers <github@albersweb.de>
@albers albers force-pushed the completion-service-options branch from 2ee36c8 to f2b42bb Compare December 15, 2017 12:52
@albers
Copy link
Collaborator Author

albers commented Dec 15, 2017

rebased because of a conflict with --generic-resources-(add|rm)

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🌮

@vdemeester vdemeester merged commit 26a2a45 into docker:master Feb 1, 2018
@GordonTheTurtle GordonTheTurtle added this to the 18.03.0 milestone Feb 1, 2018
@albers albers deleted the completion-service-options branch February 2, 2018 08:04
nobiit pushed a commit to nobidev/docker-cli that referenced this pull request Nov 19, 2025
Fix and simplify bash completion for service env, mounts and labels
Upstream-commit: 26a2a45
Component: cli
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.

6 participants