Handle commands with selectors. Support optional parameters in commands.