Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit code for empty -list search #70

Open
jnd-au opened this issue Oct 27, 2024 · 0 comments
Open

Exit code for empty -list search #70

jnd-au opened this issue Oct 27, 2024 · 0 comments

Comments

@jnd-au
Copy link
Contributor

jnd-au commented Oct 27, 2024

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.

jnd-au added a commit to jnd-au/tz that referenced this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant