refactor zsh code functions
support subcommand completions