def check_for_file(command_str, options): path = access.interpret_path(command_str) if globbing.is_glob_command(path) or access.is_valid_path(path): assert options == [] # are we ever going to have options for a file? options = [path] return create_command('file', options)
def command_refers_to_dir(command): options = command.options if len(options) == 1: option = options[0] path = access.interpret_path(option) if access.is_accessible_directory(path): return True return False