def dynamic_param_logic(text):
    """ validates parameter values for dynamic completion """
    is_param = False
    started_param = False
    prefix = ''
    param = ''
    txtspt = text.split()
    if txtspt:
        param = txtspt[-1]
        if param.startswith('-'):
            is_param = True
        elif len(txtspt) > 2 and txtspt[-2] and txtspt[-2].startswith('-'):
            is_param = True
            param = txtspt[-2]
            started_param = True
            prefix = txtspt[-1]
    return is_param, started_param, prefix, param
