def do_login(session, for_what):
    """
    Performs a login handshake with a user on the command-line.  This method
    will handle all of the follow-up requests (e.g. capcha or two-factor).  A
    login that requires two-factor looks like this::

        >>> import mwapi.cli
        >>> import mwapi
        >>> mwapi.cli.do_login(mwapi.Session("https://en.wikipedia.org"), "English Wikipedia")
        Log into English Wikipedia
        Username: Halfak (WMF)
        Passord:
        Please enter verification code from your mobile app
        Token(OATHToken): 234567

    :Parameters:
        session : :class:`mwapi.Session`
            A session object to use for login
        for_what : `str`
            A name to display to the use (for what they are logging into)
    """  # noqa
    username, password = request_username_password(for_what)
    try:
        session.login(username, password)
    except ClientInteractionRequest as cir:
        params = request_interaction(cir)
        session.continue_login(cir.login_token, **params)