rebuild command parser, split perr function to io_wrapper.

supplement: add strncpy_add_null function in cstring_more.cpp