(arg)
return arg
Validate user provided relative time
Validate user provided relative time
Validate user provided relative time
def relative_time(arg):
    """Validate user provided relative time"""
    if not re.match('\d+[smh]( +\d+[smh])*', arg):
        raise argparse.ArgumentTypeError("Invalid time format: {}".format(arg))
    return arg
def relative_time ( arg ) : if not re . match ( '\d+[smh]( +\d+[smh])*' , arg ) : raise argparse . ArgumentTypeError ( "Invalid time format: {}" . format ( arg ) ) return arg