from typing import List
from typing import Any


def __get_command(name: str, commands: List[Any], strip: bool) -> Any:
    """Pick a command from the list either by short name or name."""
    selector = 'short_name' if strip else 'name'
    for command in commands:
        if command[selector] == name:
            return command