tools/cmd_spec: Added methods to filter user input and improve printf messages