cxreg/smartcd — pull request #10 by brianphillips (2013-01-31 13:13:34+00:00)
Title: Check $# before trying to shift off $@

In ZSH, if $@ is empty, a warning is issued when trying to
use `shift`. For instance:

```
zsh% shift
shift: shift count must be <= $#
```

The fix is simple, you just check $# beforehand and no
warning is issued:
```
zsh% [[ $# > 0 ]] && shift
```