Skip to content

Exit code for empty -list search #70

@jnd-au

Description

@jnd-au

Currently, the tz -list <value> option can be used to search for timezone names and abbreviations. However, if no names are found, then tz simple prints nothing (not even an error message) and exits with ‘success’ status code 0. This is contrary to the UNIX convention of non-zero (error code) exit. For example, most search utilities (e.g. grep) will return 1 if there are no matches. It could be good if tz follows this convention, so that the exit code of tz -list <value> is the same as the exit code of tz -list | grep <value>. This would also ensure tz exits non-zero if tz’s internal tz list is empty for some reason. Also, given that this is a user mode option, it could also be good to print an error message to stderr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions