Get password

    Argument:

        args: arguments object

    Return: password string

def get_password(args):
    """Get password

    Argument:

        args: arguments object

    Return: password string
    """
    password = ''

    if args.__dict__.get('password'):
        # Specify password as argument (for -p option)
        password = args.password

    elif args.__dict__.get('P'):
        # Enter password interactively (for -P option)
        while True:
            # When setting password in $HOME/.tdclirc, using it.
            if password:
                break

            else:
                # Not set in $HOME/.tdclirc, attempt input prompt
                from getpass import getpass
                password = getpass(prompt='TonicDNS user password: ')

    return password