Skip to content

Exit code with result of check in container cli commands #619

@sypets

Description

@sypets

Currenltly all commands exit with 0 (which means non-error), even if they find something. I would like to have an exit code != 0 in case the command finds something, as in dbdoctor. This way, you can tell by the exit code whether the command found problems.

Motivation

Some commands do not fix all problems (e.g. container:integrity). In this case it might be useful to regularly run this command via cron and get alerted in case of results (e.g. send notification mail on exit code != 0) in order to fix the problem manually and / or check for bugs or wrong usage by editors.

Further considerations

Not sure if this would be breaking, e.g. if someone runs several commands and exit code != 0 aborts this.

Also, you could argue for the commands to only exit with !0 in case of an error.


I will add PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions