Files
docker-cli/cli/command/container
Sebastiaan van Stijn 37e02ff211 docker ps: print warning if both --format and --quiet are set
Of both "--quiet" and "--format" are set, --quiet takes precedence. This
patch adds a warning to inform the user that their custom format is not
used:

    docker ps --format='{{.Image}}'
    ubuntu:22.04
    alpine

    docker ps --format='{{.Image}}' --quiet
    WARNING: Ignoring custom format, because both --format and --quiet are set.
    40111f61d5c5
    482efdf39fac

The warning is printed on STDERR, so can be redirected:

    docker ps --format='{{.Image}}' --quiet 2> /dev/null
    40111f61d5c5
    482efdf39fac

The warning is only shown if the format is set using the "--format" option.
No warning is shown if a custom format is set through the CLI configuration
file:

    mkdir -p ~/.docker/
    echo '{"psFormat": "{{.Image}}"}' > ~/.docker/config.json

    docker ps
    ubuntu:22.04
    alpine

    docker ps --quiet
    40111f61d5c5
    482efdf39fac

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-04-10 01:17:48 +02:00
..
2017-10-26 12:21:02 -04:00
2022-09-30 11:59:11 +02:00
2022-06-28 17:32:09 +02:00
2022-09-30 11:59:11 +02:00
2022-09-30 11:59:11 +02:00
2022-05-13 20:50:19 +02:00
2022-06-28 17:32:09 +02:00
2022-09-30 11:59:11 +02:00
2022-12-29 15:19:24 +01:00
2022-09-30 11:59:11 +02:00
2022-03-26 20:21:00 +01:00
2022-03-26 20:21:00 +01:00
2021-05-24 19:37:53 +01:00
2021-11-05 18:10:51 +01:00
2022-06-28 17:32:09 +02:00
2022-06-28 17:32:09 +02:00
2022-05-02 14:23:07 +02:00
2018-05-11 16:49:43 -07:00
2022-06-28 17:32:09 +02:00