[PATCH v2 09/36] cli: Create a function to process characters