Skip to content

Non-existent subcommand exit code behavior changed in 1.13+ (1.13.0-rc1) #28329

@tianon

Description

@tianon

On previous versions of Docker, the validity of a subcommand could be determined by invoking docker <subcommand> --help and checking the exit code.

For existing commands (such as docker image --help), the exit code was zero indicating success.

For invalid commands (such as docker invalid --help), the exit code was non-zero, as expected.

In v1.13.0-rc1, this is no longer the case:

$ ./docker-1.12.3 images --help > /dev/null; echo $?
0
$ ./docker-1.12.3 invalid --help > /dev/null; echo $?
docker: 'invalid' is not a docker command.
See 'docker --help'.
1
$ ./docker-1.13.0-rc1 images --help > /dev/null; echo $?
0
$ ./docker-1.13.0-rc1 invalid --help > /dev/null; echo $?
0

Is this behavior change expected or accidental?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliClientpriority/P1Important: P1 issues are a top priority and a must-have for the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions