浏览代码

Merge pull request #8067 from albers/completion-no-log-prefix

Add bash completion for `docker-compose logs|up --no-log-prefix`, fix formatting of help message
Anca Iordache 4 年之前
父节点
当前提交
4990a7f935
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      compose/cli/main.py
  2. 2 2
      contrib/completion/bash/docker-compose

+ 2 - 2
compose/cli/main.py

@@ -691,7 +691,7 @@ class TopLevelCommand:
             -t, --timestamps        Show timestamps.
             --tail="all"            Number of lines to show from the end of the logs
                                     for each container.
-            --no-log-prefix    Don't print prefix in logs.
+            --no-log-prefix         Don't print prefix in logs.
         """
         containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
 
@@ -1109,7 +1109,7 @@ class TopLevelCommand:
                                        container. Implies --abort-on-container-exit.
             --scale SERVICE=NUM        Scale SERVICE to NUM instances. Overrides the
                                        `scale` setting in the Compose file if present.
-            --no-log-prefix       Don't print prefix in logs.
+            --no-log-prefix            Don't print prefix in logs.
         """
         start_deps = not options['--no-deps']
         always_recreate_deps = options['--always-recreate-deps']

+ 2 - 2
contrib/completion/bash/docker-compose

@@ -294,7 +294,7 @@ _docker_compose_logs() {
 
 	case "$cur" in
 		-*)
-			COMPREPLY=( $( compgen -W "--follow -f --help --no-color --tail --timestamps -t" -- "$cur" ) )
+			COMPREPLY=( $( compgen -W "--follow -f --help --no-color --no-log-prefix --tail --timestamps -t" -- "$cur" ) )
 			;;
 		*)
 			__docker_compose_complete_services
@@ -549,7 +549,7 @@ _docker_compose_up() {
 
 	case "$cur" in
 		-*)
-			COMPREPLY=( $( compgen -W "--abort-on-container-exit --always-recreate-deps --attach-dependencies --build -d --detach --exit-code-from --force-recreate --help --no-build --no-color --no-deps --no-recreate --no-start --renew-anon-volumes -V --remove-orphans --scale --timeout -t" -- "$cur" ) )
+			COMPREPLY=( $( compgen -W "--abort-on-container-exit --always-recreate-deps --attach-dependencies --build -d --detach --exit-code-from --force-recreate --help --no-build --no-color --no-deps --no-log-prefix --no-recreate --no-start --renew-anon-volumes -V --remove-orphans --scale --timeout -t" -- "$cur" ) )
 			;;
 		*)
 			__docker_compose_complete_services