tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
293 stars 50 forks source link

Bubble non-zero exit code from parse_tldrlist #77

Closed MasterOdin closed 2 years ago

MasterOdin commented 2 years ago

What does it do?

Makes it so that print_tldrlist will appropriately return with a non-zero code if parse_tldrlist returns with non-zero, indicating an error has occurred.

Why the change?

As pointed out in https://github.com/tldr-pages/tldr-c-client/pull/73#discussion_r780131544, with the change there (or any of the other error conditions), tldr --list will exit with no message to the user as well as a zero exit code, which is incorrect. While the state of error messaging should be improved, we should always be exiting with a non-zero exit code if an error has occurred.

How can this be tested?

Introduce an error state in parse_tldrlist (or just add a return 1; at the top of the function), should see the tldr client exit with a 1 exit code.

github-actions[bot] commented 2 years ago

Hi all! This thread has not had any recent activity. Are there any updates? Thanks!