Generalize interface for run_command().