def arg_range(arg, lo, hi):
    """
    Given a string of the format `[int][-][int]`, return a list of
    integers in the inclusive range specified. Open intervals are
    allowed, which will be capped at the `lo` and `hi` values given.

    If `arg` is empty or only contains `-`, then all integers in the
    range `[lo, hi]` will be returned.
    """
    arg = arg.strip()
    if len(arg) == 0 or arg == '-':
        return range(lo, hi+1)
    if '-' not in arg:
        return [int(arg)]
    start, end = map(str.strip, arg.split('-'))
    if len(start) == 0:
        return range(lo, int(end)+1)
    elif len(end) == 0:
        return range(int(start), hi+1)
    else:
        return range(int(start), int(end)+1)