add CMDBUF_SIZE macro
rename cmd_count to cmd_len