added a new convenience method to CommandExecutor to make the doc writing easier and eliminate all the duplication between programs