def add_flag(var, flag):
    """
    for use when calling command-line scripts from within a program.
    if a variable is present, add its proper command_line flag.
    return a string.
    """
    if var:
        var = flag + ' ' + str(var)
    else:
        var = ''
    return var
