I need to change the following Bash code to Zsh
TODO_OPTIONS="--timeout --summary"
cd ()
{
builtin cd "$@"
RV=$?
[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
return $RV
}
pushd ()
{
builtin pushd "$@"
RV=$?
[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
return $RV
}
popd ()
{
builtin popd "$@"
RV=$?
[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
return $RV
}
# Run todo initially upon login
devtodo ${TODO_OPTIONS}
I get the following error when I start Zsh with the code
todo: error, unknown argument '--timeout --summary', try --help
I feel that Zsh cannot understand the following line
[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
Other commands in the first code seems to be right for Zsh.
How can you convert the code to Zsh?