support local vars and commands and vars in command name references