Extract a new .command_for_file method