Browse Source

new: ``logs`` command has a ``--tail 10`` default parameter.

raw-remaining-args
Valentin Lab 6 years ago
parent
commit
e2d4ea6552
  1. 6
      bin/compose
  2. 8
      test/test

6
bin/compose

@ -2895,6 +2895,12 @@ case "$action" in
fi
launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${action_posargs[@]}" "${remainder_args[@]}"
;;
logs)
if ! array_member action_opts --tail; then ## force daemon mode for up
action_opts+=("--tail" "10")
fi
launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${action_posargs[@]}" "${remainder_args[@]}"
;;
"")
launch_docker_compose "${compose_opts[@]}"
;;

8
test/test

@ -1317,8 +1317,8 @@ expected="docker-compose run -T web_site"
cd "$test_tmpdir"
out=\$("$tprog" --dry-compose-run logs -ft web_site 2>&1 >/dev/null)
expected="docker-compose logs -f -t web_site"
out=\$("$tprog" --dry-compose-run logs -ft --tail 20 web_site 2>&1 >/dev/null)
expected="docker-compose logs -f -t --tail 20 web_site"
[ "\$out" == "\$expected" ] || {
echo -e "DIFF:\n\$(diff <(echo "\$out") <(echo "\$expected"))"
@ -1380,8 +1380,8 @@ expected_reg="Unknown option '-Z'"
cd "$test_tmpdir"
out=\$("$tprog" --dry-compose-run logs web_site mysql 2>&1 >/dev/null)
expected="docker-compose logs web_site mysql"
out=\$("$tprog" --dry-compose-run logs --tail 15 web_site mysql 2>&1 >/dev/null)
expected="docker-compose logs --tail 15 web_site mysql"
[ "\$out" == "\$expected" ] || {
echo -e "DIFF:\n\$(diff <(echo "\$out") <(echo "\$expected"))"

Loading…
Cancel
Save