exit status after redis-cli command failure

294 views
Skip to first unread message

wyar...@gmail.com

unread,
May 12, 2016, 3:21:32 PM5/12/16
to Redis DB
With RHEL / CentOS version of Redis, if a non-interactive command (such as flushall) is run with redis-cli and fails, the program still exits with a 0 status code instead of 1:

$ redis-cli --version
redis-cli 2.8.3
$ redis-cli flushall
(error) NOAUTH Authentication required.
$ echo $?
0

Built 3.0.7, and behavior is the same.
% ./redis-cli --version
redis-cli 3.0.7
% ./redis-cli flushall
(error) NOAUTH Authentication required.
% echo $?
0
% ./redis-cli asdfsdafadsf
(error) ERR unknown command 'asdfsdafadsf'
% echo $?
0
% ./redis-cli CONFIG     
(error) ERR wrong number of arguments for 'config' command
% echo $?          
0

Additionally, it would be really nice if a man page for, e.g., redis-cli, was built. Since the help text is already generated, it should not be too difficult.
Reply all
Reply to author
Forward
0 new messages