1 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
52752f3aa2
inspect: improve (flag) validation
Produce an error if the `--type` flag was set, but an empty value
was passed.

Before this patch:

    docker inspect --type "" foo
    # json output

    docker inspect --type unknown foo
    "unknown" is not a valid value for --type

With this patch:

    docker inspect --type "" foo
    type is empty: must be one of "config", "container", "image", "network", "node", "plugin", "secret", "service", "task", "volume"

    docker inspect --type unknown foo
    unknown type: "unknown": must be one of "config", "container", "image", "network", "node", "plugin", "secret", "service", "task", "volume"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-06 15:54:29 +02:00