# I have a function like this:
#     p() { cd ~/Clients/$1/Projects/$2; }
# Then I can type:
#     p "Client here" "Project here"
# and it takes me to:
#     ~/Clients/Client here/Projects/Project here

# p() { cd ~/Clients/$1/Projects/$2; }
_p() {
  _arguments '1: :->client' '2: :->project'
  case $state in
    client)
      _files -W ~/Clients
    ;;
    project)
      _files -W ~/Clients/$words[CURRENT-1]/Projects
    ;;
  esac 
}
compdef _p p

# UPDATE: Change $words[CURRENT-1] to ${(Q)words[CURRENT-1]} to make it work
# with directories containing spaces:

# p() { cd ~/Clients/$1/Projects/$2; }
_p() {
  _arguments '1: :->client' '2: :->project'
  case $state in
    client)
      _files -W ~/Clients
    ;;
    project)
      _files -W ~/Clients/${(Q)words[CURRENT-1]}/Projects
    ;;
  esac 
}
compdef _p p
