def parseTarget(target, forceSSH=False, useOption=False):
    """parseTarget(target[,forceSSH,useOption]) --> (login, host, path)
    if useOption, then login will prepend '-l' if login is included"""
    dpath = target.split(':')[-1]
    rhost = target.split(':')[0]
    if rhost == dpath:
        if forceSSH:
            return '', 'localhost', dpath
        return '', '', dpath
    dhost = rhost.split('@')[-1]
    duser = rhost.split('@')[0]
    if duser == dhost:
        return '', dhost, dpath
    if useOption:
        duser = '-l ' + duser
    return duser, dhost, dpath
