def update_progress_bar(bar, show_progress=True, finish=False):
    """helper to handle progress bar updates in vidstab process

    :param bar: progress bar to be updated
    :param show_progress: user set flag of whether or not to display progress bar
    :param finish: finish progress bar
    :return: updated progress bar
    """
    if show_progress and bar is not None:
        bar.next()
        if finish:
            bar.finish()
