cli: add utility routine to print error status.