'A command argument that can take an integer or \'all\'.'

def int_all_type(self, value):

    if (value.strip().lower() == 'all'):
        return 'all'
    try:
        as_int = int(value)
    except ValueError:
        msg = ("%r    should    be    'all'    or    an    integer" % value)
        raise ArgumentTypeError(msg)
    return as_int
