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.
What does it do?
Makes it so that
print_tldrlist
will appropriately return with a non-zero code ifparse_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 areturn 1;
at the top of the function), should see the tldr client exit with a 1 exit code.