def tryname(text):
    """Try to make a loosely POSIX-style name."""
    stripped = str(text).strip()
    if not stripped:
        raise ValueError('Cannot make an option name from an empty string.')
    if not stripped[:1].isalnum():
        return stripped
    name = '-'.join(stripped.split())
    return f'-{name}' if len(name) == 1 else f'--{name}'
