The problem/use-case that the feature addresses
When running flushall from Jenkins CI one would expect that a failing command should fail the job. However, redis-cli returns 0 even if the command is not executed and thus the job is finished as OK.
# redis-cli flushall
NOPERM this user has no permissions to run the 'flushall' command or its subcommand
# echo $?
0
Description of the feature
Any exit code except for 0 is fine.
# redis-cli flushall
NOPERM this user has no permissions to run the 'flushall' command or its subcommand
# echo $?
1
Comment From: oranagra
@hydrapolic thanks for reaching out.
from a quick look it seems that cliReadReply isn't propagating the error upwards (it succeeded to communicate to redis and reports that as a success).
in your simple case it is easy to see that it should have, but there are different cases where redis-cli is used (with multiple commands, or repeat), we may or may not want to terminate the execution as soon as one command errors (maybe this should be exposed as a command line option), and if we don't then question is if the return code should be reflected by the fact that one of the command failed (not necessarily the last one).