Fix Auto complete options available:

- Add support for --gpus to run/create container in bash and zsh
  - Remove --group from run and update container as it's not a valid flag in zsh
  - Add --group-add --group-rm for create and update update service in bash

Signed-off-by: Richard Chen Zheng <58443436+rchenzheng@users.noreply.github.com>
This commit is contained in:
Richard Chen Zheng 2020-08-09 11:30:50 -04:00
parent 51d96c7e08
commit 288326da1c
No known key found for this signature in database
GPG Key ID: 60AEBAFDD387815E
2 changed files with 4 additions and 1 deletions

View File

@ -1894,6 +1894,7 @@ _docker_container_run_and_create() {
--env -e --env -e
--env-file --env-file
--expose --expose
--gpus
--group-add --group-add
--health-cmd --health-cmd
--health-interval --health-interval

View File

@ -624,7 +624,8 @@ __docker_container_subcommand() {
"($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: " "($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: "
"($help)*--env-file=[Read environment variables from a file]:environment file:_files" "($help)*--env-file=[Read environment variables from a file]:environment file:_files"
"($help)*--expose=[Expose a port from the container without publishing it]: " "($help)*--expose=[Expose a port from the container without publishing it]: "
"($help)*--group=[Set one or more supplementary user groups for the container]:group:_groups" "($help)*--gpus=[GPU devices to add to the container ('all' to pass all GPUs)]:device: "
"($help)*--group-add=[Set one or more supplementary user groups for the container]:group:_groups"
"($help -h --hostname)"{-h=,--hostname=}"[Container host name]:hostname:_hosts" "($help -h --hostname)"{-h=,--hostname=}"[Container host name]:hostname:_hosts"
"($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]" "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]"
"($help)--init[Run an init inside the container that forwards signals and reaps processes]" "($help)--init[Run an init inside the container that forwards signals and reaps processes]"
@ -2015,6 +2016,7 @@ __docker_service_subcommand() {
"($help)*--dns-option=[Set DNS options]:DNS option: " \ "($help)*--dns-option=[Set DNS options]:DNS option: " \
"($help)*--dns-search=[Set custom DNS search domains]:DNS search: " \ "($help)*--dns-search=[Set custom DNS search domains]:DNS search: " \
"($help)*--env-file=[Read environment variables from a file]:environment file:_files" \ "($help)*--env-file=[Read environment variables from a file]:environment file:_files" \
"($help)*--group=[Set one or more supplementary user groups for the container]:group: _groups " \
"($help)--mode=[Service Mode]:mode:(global replicated)" \ "($help)--mode=[Service Mode]:mode:(global replicated)" \
"($help)--name=[Service name]:name: " \ "($help)--name=[Service name]:name: " \
"($help)*--placement-pref=[Add a placement preference]:pref:__docker_service_complete_placement_pref" \ "($help)*--placement-pref=[Add a placement preference]:pref:__docker_service_complete_placement_pref" \